Repository navigation
[python/strands_agents] breaking: remove the context window overflow gate before 1.0 - #575
Merged
Merged
Conversation
campoy
force-pushed
the
breaking/strands-remove-overflow-gate
branch
from
November 16, 2026 07:08
016a485 to
aa82d40
Compare
campoy
marked this pull request as ready for review
November 16, 2026 16:10
…ore 1.0 Replay is promised only within a major, and the next Strands release is 1.0. The strands-agents.context-window-overflow-recovery patch (#146) only kept 0.x runs on the old path, so it goes: a model Activity that fails with a context window overflow always raises ContextWindowOverflowException in the Workflow now.
campoy
force-pushed
the
breaking/strands-remove-overflow-gate
branch
from
November 16, 2026 18:23
7308aa1 to
0ce40d9
Compare
brianstrauch
approved these changes
Nov 16, 2026
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.
What was changed
Strands Python ships 1.0 next, so its current major is 1, and replay is promised only within a major (the rule #565 adds to AGENTS.md). The
strands-agents.context-window-overflow-recoverypatch from #146 only keeps runs without its marker on the old path. Those are 0.x runs, so let's remove it before 1.0.A model Activity that fails with a context window overflow now always raises
ContextWindowOverflowExceptionin the Workflow, so Strands reduces the conversation and calls the model again. The overflow test no longer checks for the marker.This PR doesn't need #565: no committed history reaches this gate.
What will you notice? (Breaking)
A 0.x run whose Workflow got a model overflow as an
ActivityErrorfails replay on 1.0 with[TMPRL1100]. In practice that adds nothing new: every 0.x agent run already fails replay on 1.0, at the model config read from #194 (invoke_modelwhere 1.0 schedulesstrands_get_model_config).A run on a
mainbuild since #146 that hit an overflow recorded the marker, so it doesn't replay either. No release wrote that marker.It breaks the other way too. A run that hits an overflow on this version doesn't record the marker, so it fails replay with
[TMPRL1100]on amainbuild that has the gate. Runs that never hit an overflow replay on both.What should you do?
The README now says this next to the other upgrade notes:
Why?
We decided that replay is promised only within a major, and that a gate that only protects an older major's runs is removed before the next major ships. Strands' next release is 1.0, so this gate goes before it.
Checklist
No issue.
How was this tested:
make format,make lintandmake testforpython/strands_agentson Python 3.12: 282 passed, 1 skipped. After the README change,make sync,make lintandmake teston Python 3.13: 282 passed, 1 skipped.ActivityErrorand runs a fallback Activity, and a plain run. I recorded them onmainand on this PR. OnmainI also recorded both overflow runs withworkflow.patched()returningFalsefor this gate, which is what a Workflow without the gate (0.x) does. Then I replayed every one on both builds, along with Let Strands recover from model context window overflow in TemporalAgent #146's fallback history (recorded on 0.1.0's code) and a history with a renamed Activity.[TMPRL1100]: the two old-path runs, the two overflow runs frommain(Non-deprecated patch marker encountered), Let Strands recover from model context window overflow in TemporalAgent #146's 0.x history (at the model config read, as onmain), and the renamed Activity. Everything recorded on this PR replays, and so does the plain run frommain.main: this PR's two overflow histories fail with[TMPRL1100]; the plain one replays.Any docs updates needed? Yes, and they're in this PR. The Strands README now says what happens to runs that hit an overflow, and how to upgrade and roll back with them open.