fix(codex): pass maxRenderedHistoryContextChars to legacy mirrored-history fallback#1
Open
thomaszta wants to merge 1 commit into
Open
fix(codex): pass maxRenderedHistoryContextChars to legacy mirrored-history fallback#1thomaszta wants to merge 1 commit into
thomaszta wants to merge 1 commit into
Conversation
…allback The legacy mirrored-history fallback at run-attempt.ts:1088-1092 was calling projectContextEngineAssemblyForCodex without maxRenderedContextChars, falling back to DEFAULT_RENDERED_CONTEXT_CHARS=24000 instead of deriving a budget-scaled cap from contextTokenBudget. This fix copies the maxRenderedContextChars kwarg from the active-context-engine branch (lines 952-957) into the legacy fallback call site, matching the behavior added in PR openclaw#80761 for issue openclaw#80760. Fixes openclaw#84084
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
What problem does this PR solve?
run-attempt.ts:1088-1092was callingprojectContextEngineAssemblyForCodexwithout passingmaxRenderedContextChars, causing it to fall back toDEFAULT_RENDERED_CONTEXT_CHARS = 24000instead of deriving a budget-scaled cap fromcontextTokenBudget.Why does this matter now?
contextTokenBudget(e.g., 272,000 tokens) were being limited to ~24k rendered characters (~6k tokens) of projected history on mid-session Codex thread rebuilds, while stable channels reached 33-43% context usage.What is the intended outcome?
maxRenderedContextCharsderived fromcontextTokenBudget, matching the active-context-engine branch behavior added in PR fix(codex): scale context engine projection openclaw/openclaw#80761 for issue Codex context-engine projection caps LCM output to 24k chars, hiding full-fit context openclaw/openclaw#80760.What is intentionally out of scope?
What does success look like?
What should reviewers focus on?
extensions/codex/src/app-server/run-attempt.ts:1088-1098— the legacy fallback call siteLinked context
Which issue does this close?
Which issues, PRs, or discussions are related?
Was this requested by a maintainer or owner?
Real behavior proof (required for external PRs)
maxRenderedContextCharsderived fromresolveCodexContextEngineProjectionMaxChars()at legacy fallback call site, matching active-context-engine pattern at lines 952-957maxRenderedContextCharskwarg