[codex] Unify ask mode through session turns#80
Conversation
There was a problem hiding this comment.
💡 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".
| const systemContext = appendMemoryCatalogSystemContext({ | ||
| systemContext: options.systemContext, | ||
| memoryRoot: join(stateRoot, 'memory'), | ||
| }); |
There was a problem hiding this comment.
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 👍 / 👎.
Summary
sessionSendPromptinstead of the legacy raw ask endpointretentionmetadata for reusable versus one-off sessionsmaxSteps,searchIgnoreDirs, andincludePlanToolthrough engine turns and control-plane session sendsask.tsaround anAskCliHostclass while keepingrunAskCli()as the public entrypointWhy
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.tsyarn lintyarn build