fix(codex): pass budget-scaled maxRenderedContextChars to legacy mirrored-history projection#94647
Conversation
…ored-history projection - Add maxRenderedContextChars to applyFreshThreadContinuityProjection (fresh thread legacy path) - Add maxRenderedContextChars to applyResumeStaleBindingContinuityProjection (stale binding legacy path) - Reuse existing resolveCodexContextEngineProjectionMaxChars / resolveCodexContextEngineProjectionReserveTokens helpers - Matches the active-context-engine pattern from PR openclaw#80761 Fixes openclaw#84084 Co-Authored-By: Claude <[email protected]>
|
Codex review: needs real behavior proof before merge. Reviewed June 18, 2026, 12:52 PM ET / 16:52 UTC. Summary PR surface: Source +12. Total +12 across 1 file. Reproducibility: yes. source inspection shows current main omits Review metrics: none identified. Root-cause cluster Members:
Proposal only: this assessment does not dispatch repair, suppress jobs, mutate sibling items, close, or merge anything. Merge readiness Overall follows the weaker of proof and patch quality, so missing proof can cap an otherwise strong patch. Rank-up moves:
Proof guidance:
Risk before merge
Maintainer options:
Next step before merge
Security Review detailsBest possible solution: Land the parity fix after contributor-supplied real behavior proof or maintainer proof override, preferably with focused legacy-call-site regression coverage. Do we have a high-confidence way to reproduce the issue? Yes: source inspection shows current main omits Is this the best way to solve the issue? Yes: reusing the existing budget-scaled projection helper at the two legacy continuity calls is the narrowest maintainable fix. The remaining blocker is proof and optional focused regression coverage, not a different product direction. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning high; reviewed against 1eaace70e3b4. Label changesLabel changes:
Label justifications:
Evidence reviewedPR surface: Source +12. Total +12 across 1 file. View PR surface stats
What I checked:
Likely related people:
What the crustacean ranks mean
Shiny media proof means a screenshot, video, or linked artifact directly shows the changed behavior. Runtime, network, CSP, and security claims still need visible diagnostics. How this review workflow works
|
|
Closing as superseded by #94093. PR #94093 ( The merge conflict was a signal that the fix had already landed on main through another path. |
Summary
The legacy mirrored-history fallback in
extensions/codex/src/app-server/run-attempt.tscallsprojectContextEngineAssemblyForCodexwithout passingmaxRenderedContextChars. When omitted, the function defaults toDEFAULT_RENDERED_CONTEXT_CHARS = 24_000(~6,000 tokens of rendered history), even when the model has a much larger context budget (e.g., 272,000 tokens).This PR passes the budget-scaled
maxRenderedContextCharsto both legacy projection call sites, matching the active-context-engine branch behavior added in PR #80761.Fixes #84084
Real behavior proof (required for external PRs)
Behavior addressed: Legacy mirrored-history projection caps rendered context at 24,000 characters regardless of the model's actual context budget.
Real setup tested:
Exact steps or command run after fix:
After-fix evidence:
Diff:
Observed result after the fix: All existing tests pass.
contextTokenBudgetis already in scope at both call sites. WhencontextTokenBudgetis undefined,resolveCodexContextEngineProjectionMaxCharsfalls back toDEFAULT_RENDERED_CONTEXT_CHARS— no behavior change for that case.What was not tested: Live high-window Codex session with thread rebuilds. The fix is source-proven and the helpers are already tested.
Tests and validation
Risk checklist
Did user-visible behavior change? (
Yes— legacy fallback now uses budget-appropriate cap instead of 24k hard default)Did config, environment, or migration behavior change? (
No)Did security, auth, secrets, network, or tool execution behavior change? (
No)What is the highest-risk area?
contextTokenBudgetis undefined,resolveCodexContextEngineProjectionMaxCharsreturnsDEFAULT_RENDERED_CONTEXT_CHARS— same as before.How is that risk mitigated?
params.contextTokenBudgetandparams.configare already in scope and used by other paths.Current review state
What is the next action?