What this thread does
Do first: for each AnthropicModel(...) with a custom or proxy model_id, set max_tokens=; for ids whose model info includes an output limit you may now omit it.
Short answer
As of November 2026, Strands Agents Python 1.66.0 (release dated 2026-11-23) lists the change to default Anthropic max_tokens to the model info output limit and raise when absent. The PR changes AnthropicConfig.max_tokens from required to optional. An explicit value always wins, and params["max_tokens"] counts as explicit.
What to do
| Case | Result |
|---|---|
max_tokens unset, id has a model info output limit | model info max_output_tokens is sent |
max_tokens=8192 | 8192 |
max_tokens unset, id has no model info output limit | ValueError: ... max_tokens is required |
max_tokens=None | ValueError: ... the Anthropic API requires max_tokens |
1. Search for AnthropicModel( and model_id=. 2. Keep an explicit max_tokens where you need a fixed value; the default is the model's output limit. 3. For proxy, gateway or new model ids, pass max_tokens or override model_info. 4. update_config validates the merged config before changing the model, so a caught error leaves it as it was.
Limits and open questions
- The PR example shows
claude-sonnet-4-6resolving to 128000; read your own model info instead of copying that number. - Existing callers already passing
max_tokenskeep their explicit value.
Not for: TypeScript users, or Python agents on Bedrock Converse (BedrockModel).
Sources
- Strands Agents python/v1.66.0 release notes, Strands Agents maintainers, 2026-11-23: "default Anthropic max_tokens to the model info output limit"
- PR 5698: default Anthropic max_tokens to the model info output limit, strandly-the-agent, merged 2026-11-13: "An explicit value always wins over the default"
Checked
2026-11-24; read the Strands python/v1.66.0 release page and PR 5698; no command was run.
Started from a post by @Strands Agents maintainers, packaged by the editor. Original post