Skip to content

[python/strands_agents] breaking: remove the context window overflow gate before 1.0 - #575

Merged
campoy merged 2 commits into
mainfrom
breaking/strands-remove-overflow-gate
Nov 17, 2026
Merged

campoy merged 2 commits into
mainfrom
breaking/strands-remove-overflow-gate

Conversation

@campoy

@campoy campoy commented Nov 16, 2026 •

Copy link
Copy Markdown
Contributor

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-recovery patch 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 ContextWindowOverflowException in 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 ActivityError fails 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_model where 1.0 schedules strands_get_model_config).

A run on a main build 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 a main build 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:

  • Let runs that hit an overflow before you upgrade finish on their original workers, or keep them there with Worker Versioning.
  • Don't roll workers back to an earlier version while runs that hit an overflow on this version are open. Use Worker Versioning if you need to roll back.
  • Runs that never hit an overflow need nothing new.

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

  1. No issue.

  2. How was this tested:

    • make format, make lint and make test for python/strands_agents on Python 3.12: 282 passed, 1 skipped. After the README change, make sync, make lint and make test on Python 3.13: 282 passed, 1 skipped.
    • Replay, across builds. On Workers with no Workflow cache, I recorded a run that recovers from an overflow, a run whose model always overflows inside a Workflow that catches ActivityError and runs a fallback Activity, and a plain run. I recorded them on main and on this PR. On main I also recorded both overflow runs with workflow.patched() returning False for 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.
    • On this PR, only these fail, each with [TMPRL1100]: the two old-path runs, the two overflow runs from main (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 on main), and the renamed Activity. Everything recorded on this PR replays, and so does the plain run from main.
    • Rollback to main: this PR's two overflow histories fail with [TMPRL1100]; the plain one replays.
  3. 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.

@campoy
campoy force-pushed the breaking/strands-remove-overflow-gate branch from 016a485 to aa82d40 Compare November 16, 2026 07:08
@campoy
campoy changed the base branch from replay/major-scoped-histories to main November 16, 2026 07:08
@campoy
campoy marked this pull request as ready for review November 16, 2026 16:10
@campoy
campoy requested a review from a team as a code owner November 16, 2026 16:10
@campoy campoy changed the title Breaking: strands_agents: remove the context window overflow gate before 1.0 [strands-agents-python] breaking: remove the context window overflow gate before 1.0 Nov 16, 2026
…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
campoy force-pushed the breaking/strands-remove-overflow-gate branch from 7308aa1 to 0ce40d9 Compare November 16, 2026 18:23
@campoy campoy changed the title [strands-agents-python] breaking: remove the context window overflow gate before 1.0 [python/strands_agents] breaking: remove the context window overflow gate before 1.0 Nov 16, 2026
@campoy
campoy merged commit 007083f into main Nov 17, 2026
29 checks passed
@campoy
campoy deleted the breaking/strands-remove-overflow-gate branch November 17, 2026 00:51
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.

2 participants