Skip to content

Rectify Codex Session Result Adaptation — Context Exhaustion and Recovery Paths#3393

Merged
Trecek merged 4 commits into
developfrom
rectify-codex-session-result-adaptation-context-exhaustion-a/3384
May 31, 2026
Merged

Rectify Codex Session Result Adaptation — Context Exhaustion and Recovery Paths#3393
Trecek merged 4 commits into
developfrom
rectify-codex-session-result-adaptation-context-exhaustion-a/3384

Conversation

@Trecek
Copy link
Copy Markdown
Collaborator

@Trecek Trecek commented May 31, 2026

No description provided.

Trecek and others added 4 commits May 30, 2026 23:31
Add structured error_code field to _CodexParseAccumulator, store it on
turn.failed events, include in raw dict, and use it in _adapt_agent_result
for context exhaustion detection and API error status mapping.

- Add error_code: str = "" to _CodexParseAccumulator
- Store acc.error_code in turn.failed handler
- Include error_code in raw dict from parse_stdout
- Populate errors from agent_result.error (was always [])
- Map rate_limit_exceeded -> api_error_status=429
- Use CODEX_CONTEXT_EXHAUSTION_MARKER constant for structured detection
- Update tests: fix round-trip assertion, add 5 new tests, remove Phase C simulation

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
CanonicalTokenUsage.from_codex_dict requires output_tokens key; the test
fixture was missing it, causing KeyError on turn.completed events.
…ops falsy int status codes

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
…ver new field

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@Trecek Trecek force-pushed the rectify-codex-session-result-adaptation-context-exhaustion-a/3384 branch from 17066c1 to 1fc9fed Compare May 31, 2026 06:31
@Trecek Trecek added this pull request to the merge queue May 31, 2026
Merged via the queue into develop with commit 403a00c May 31, 2026
3 checks passed
@Trecek Trecek deleted the rectify-codex-session-result-adaptation-context-exhaustion-a/3384 branch May 31, 2026 06:40
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