Repository navigation
Conversation
…window A Codex thread at 366k/475k tokens whose previous run failed to start refuses every later turn with ContextHandoffBudgetError. This test fails until the fix lands. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…l thread When a run fails before the provider sees it, the next turn on the same native thread replays the missed items as a retry handoff. The handoff budget reserves a quarter of the window on top of measured usage, so a thread past about 75% full had no budget for even the recovery pointer. Every later turn failed with ContextHandoffBudgetError and added another missed run, until the user compacted. The missed items are optional context for a native thread that already holds the conversation. When they cannot fit, deliver the required handoffs alone and record the retry handoff as omitted once the provider accepts the turn, so it is not offered again. Required handoffs still fail with ContextHandoffBudgetError when they do not fit. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Contributor
Member
|
Taking over this one. I will keep this focused on failed-start retries in nearly full native threads, preserve required handoff failures, and verify the rebuilt change before pushing here. |
2 tasks done
Member
|
Closing in favour of #24703, which makes the same change. Thanks for the work here! |
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.
A run that fails before reaching its provider can make every later request fail on a nearly full native thread: replaying the missed request exceeds the context-handoff allowance even though the native conversation can still accept the new request.
The start service retries delivery with required handoffs only when optional missed-run recovery cannot fit in the same native thread. It records the missed items as omitted after the provider accepts the new turn. Required handoffs retain their budget failures. Budget calculations, contracts and provider adapters are unchanged.
Continues @stebo85's work in #21011, merged onto current main while preserving the author's commits. The rebuild replaces a zero-or-one array and its mapped persistence with one optional handoff, and explicitly requires reuse of the same native thread. This stays limited to failed-start retries.
Verification:
The near-full usage report was simulated at 200,000/258,400 tokens in isolated test state; the native conversation itself was not organically filled. The failures, provider starts, replies and omission bookkeeping ran through the real server and Codex adapter. Required handoff rejection is covered by the integration harness, not a live provider switch.
Before — main refuses the retry:
After — guarded retry completes in the original conversation:
Not verified: an organically full Codex conversation, macOS, Windows, iOS, Android, or Electron desktop. Human maintainer review remains required.
Implemented through T3 Code's Codex harness with GPT-6.1-Sol; tests by GPT-6-Astra; independent reviews by GPT-6-Sol and Claude Opus 5.5 through T3 Code.