Add a fallback phase before automatic context rollover - #33255
Merged
copyberry[bot] merged 1 commit intoJul 15, 2026
Merged
Conversation
## Why Token-budget sessions need a final opportunity to preserve important state before the current context is compacted. ## What changed - When `auto_compact_fallback_prompt` is configured, reserve `auto_compact_fallback_buffer_tokens` beyond the base auto-compaction limit. - At the base limit, inject the fallback prompt once as a developer message while keeping the normal tool surface available. Continue reporting zero base-window tokens during this reserve. - Roll over when the reserve or full model context is exhausted, and skip the fallback when a new context was already requested. ## Testing Added coverage for using the fallback reserve, rolling over after it is exhausted, and bypassing the fallback for an explicit `new_context` request. GitOrigin-RevId: 32983ecadc5cb4927e15ecd7b1e896cb52a9ad3b
copyberry
Bot
force-pushed
the
copyberry/codex-internal-to-codex-oss/32983ecadc5cb4927e15ecd7b1e896cb52a9ad3b
branch
from
July 15, 2026 05:46
43199cc to
768330d
Compare
copyberry
Bot
deleted the
copyberry/codex-internal-to-codex-oss/32983ecadc5cb4927e15ecd7b1e896cb52a9ad3b
branch
July 15, 2026 05:48
briantcl1992
temporarily deployed
to
issue-triage
July 15, 2026 05:50 — with
GitHub Actions
Inactive
briantcl1992
temporarily deployed
to
issue-triage
July 15, 2026 05:50 — with
GitHub Actions
Inactive
briantcl1992
temporarily deployed
to
issue-triage
July 15, 2026 05:50 — with
GitHub Actions
Inactive
biigblackcat
temporarily deployed
to
issue-triage
July 15, 2026 05:53 — with
GitHub Actions
Inactive
biigblackcat
temporarily deployed
to
issue-triage
July 15, 2026 05:53 — with
GitHub Actions
Inactive
biigblackcat
temporarily deployed
to
issue-triage
July 15, 2026 05:53 — with
GitHub Actions
Inactive
biigblackcat
temporarily deployed
to
issue-triage
July 15, 2026 05:54 — with
GitHub Actions
Inactive
Jason-Wang313
temporarily deployed
to
issue-triage
July 15, 2026 05:56 — with
GitHub Actions
Inactive
Jason-Wang313
temporarily deployed
to
issue-triage
July 15, 2026 05:56 — with
GitHub Actions
Inactive
Jason-Wang313
temporarily deployed
to
issue-triage
July 15, 2026 05:56 — with
GitHub Actions
Inactive
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 subscribe to this conversation on GitHub.
Already have an account?
Sign in.
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.
Add a fallback phase before automatic context rollover
Why
Token-budget sessions need a final opportunity to preserve important state before the current context is compacted.
What changed
auto_compact_fallback_promptis configured, reserveauto_compact_fallback_buffer_tokensbeyond the base auto-compaction limit.Testing
Added coverage for using the fallback reserve, rolling over after it is exhausted, and bypassing the fallback for an explicit
new_contextrequest.