Skip to content

[codex] Unify ask mode through session turns#80

Merged
roackb2 merged 2 commits into
mainfrom
codex/ask-engine-unification
May 15, 2026
Merged

[codex] Unify ask mode through session turns#80
roackb2 merged 2 commits into
mainfrom
codex/ask-engine-unification

Conversation

@roackb2
Copy link
Copy Markdown
Owner

@roackb2 roackb2 commented May 15, 2026

Summary

  • route default local ask through the conversation engine by creating a persisted one-off chat session
  • route daemon default ask through control-plane session creation plus sessionSendPrompt instead of the legacy raw ask endpoint
  • add session retention metadata for reusable versus one-off sessions
  • expose maxSteps, searchIgnoreDirs, and includePlanTool through engine turns and control-plane session sends
  • organize ask.ts around an AskCliHost class while keeping runAskCli() as the public entrypoint

Why

The P1 ask unification plan depends on removing capability differences between default ask, reusable session ask, local execution, and daemon execution. This change makes "stateless" ask a one-off persisted session instead of a separate runtime path, so trace persistence, memory maintenance, compaction behavior, and future turn options converge on the same engine flow.

Validation

  • yarn test src/__tests__/integration/tui/ask-cli.test.ts
  • yarn lint
  • yarn build

@roackb2 roackb2 marked this pull request as ready for review May 15, 2026 15:12
@roackb2 roackb2 merged commit ced4cdf into main May 15, 2026
4 checks passed
Copy link
Copy Markdown

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 351ee0553d

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread src/cli/ask.ts
Comment on lines +76 to +79
const systemContext = appendMemoryCatalogSystemContext({
systemContext: options.systemContext,
memoryRoot: join(stateRoot, 'memory'),
});
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Pass raw system context into session-backed ask turns

After this change, default local heddle ask always runs through turns.submit, and the turn runtime already appends memory catalog context (src/core/chat/engine/turns/runtime.ts, appendMemoryCatalogSystemContext). Building systemContext with appendMemoryCatalogSystemContext here and then forwarding it into the engine causes the memory block to be injected twice for default ask, which wastes context window/tokens and can trigger earlier compaction on large memory catalogs. This path should pass options.systemContext through and let the turn runtime own memory-context injection once.

Useful? React with 👍 / 👎.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant