fix(codex): replace compacted tool output - #212
Conversation
|
You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard. |
|
Correction after separating actual rewrites from keep/skip decisions and checking Codex's current PostToolUse implementation:
Updated conclusion: PR #212 does achieve real replacement/context savings on the rewrite path, and recent local sessions do exercise that code. It also introduces a genuine Stopped-status/default-feedback tradeoff that the current live E2E does not assert away. Setting |
|
Follow-up fix pushed in The replacement response now sets both a concise
The full compacted result remains only in Verification:
|
|
Documented and re-verified the Codex replacement tradeoff in With the currently tested Codex CLI, suppressing the original This is expected only when both the Tokenjuice replacement reason and compacted hook context are present. Here, The authenticated live E2E now also locks down turn continuation: it requires a later non-empty assistant response after the compacted developer context. Latest real run passed with:
That is an 85.9% character reduction in this fixture (a context-size proxy, not an exact billed-token measurement). Docs added/updated: |
Summary
continue: falsefor compacted CodexPostToolUsefeedback so Codex suppresses the original tool resultpnpm e2e:codex-live, an authenticated manual regression that runs the realcodex execWhy
Codex treats
hookSpecificOutput.additionalContextas additive by default. The existing adapter therefore sent both the raw tool result and the compacted summary to the model, increasing context usage instead of reducing it.With
continue: false, Codex continues the turn from the compacted feedback while keeping the original result out of model context.The offline adapter contract remains fast, while the new live E2E prevents a regression where adapter JSON looks correct but the real Codex model context is not replaced.
Live E2E
pnpm e2e:codex-live:CODEX_HOMEghcommand through the real Codex CLIfunction_call_outputrewrote: trueTOKENJUICE_NO_OMISSION=1Measured with Codex CLI 0.144.5:
This command requires an existing Codex login, invokes a model, and consumes account quota. It is intentionally manual-only and is not part of normal CI.
Verification
env -u TOKENJUICE_NO_OMISSION pnpm verify— 2286 tests passedpnpm exec vitest run test/hosts/codex.test.ts -t "returns post-tool feedback without a block decision when tokenjuice compacts output"pnpm e2e:localpnpm e2e:codex-livegitleaks detect --no-git --redact --no-banner --source .