fix: preserve explicit context window on generic overflow#14953
Closed
atmigtnca wants to merge 1 commit into
Closed
fix: preserve explicit context window on generic overflow#14953atmigtnca wants to merge 1 commit into
atmigtnca wants to merge 1 commit into
Conversation
This was referenced Apr 27, 2026
Closed
Contributor
|
Closing — same root cause was addressed via #33826 (salvaged from #33673 by @yangguangjin). Your earlier PR identified and partially fixed the same bug (preserving explicit Thanks for the original work and analysis here — it informed the eventual fix. |
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
model.context_lengthwhen a generic context-overflow error does not include a concrete provider limit.Test Plan
python -m pytest tests/test_ctx_halving_fix.py -q -o 'addopts='python -m pytest tests/agent/test_model_metadata.py tests/run_agent/test_switch_model_context.py tests/run_agent/test_compressor_fallback_update.py -q -o 'addopts='Context
Long-running TUI sessions with an explicit 1M context configuration could fall back to the generic 128K probe tier after a generic overflow/transport error that did not report an actual lower context limit. This made the status bar suddenly show 128K even though the configured model window was still 1M.