Describe the bug
When a Bedrock response reaches the output token limit, AWS returns stopReason: "max_tokens", but the Bedrock provider ignores it. The response just stops (often mid-thinking, before any tool call), and the task then reports an unrelated error such as "You did not use a tool…" instead of saying the output limit was reached.
This is more likely on adaptive-thinking models (Claude 4.7+), where Zoo Code sends effort: "xhigh" without a thinking budget, so thinking can use most of the limit.
The user also cannot work around it: with reasoning enabled, the "Max Output Tokens" slider stops at 16,384 on Bedrock, while the direct Anthropic provider allows up to 64k/128k for the same models.
To Reproduce
Steps to reproduce the behavior:
- Select the Amazon Bedrock provider and
anthropic.claude-opus-4-8, with reasoning enabled.
- Open the "Max Output Tokens" slider: its maximum is 16,384.
- Give a complex task (e.g. a large refactor or a long file to write).
- If thinking and output exceed the limit, the response stops mid-way and the task reports a generic error.
Expected behavior
- When a response hits the output limit, the user gets a clear message (e.g. "Output token limit reached, consider increasing Max Output Tokens").
- The slider can go up to the model's documented limit, as with the Anthropic provider. The 16,384 default can stay: a high
max_tokens reserves Bedrock quota up front and reduces the context available for the conversation.
Screenshots
Video
What version of zoo are you running
3.82.1
Additional context
Describe the bug
When a Bedrock response reaches the output token limit, AWS returns
stopReason: "max_tokens", but the Bedrock provider ignores it. The response just stops (often mid-thinking, before any tool call), and the task then reports an unrelated error such as "You did not use a tool…" instead of saying the output limit was reached.This is more likely on adaptive-thinking models (Claude 4.7+), where Zoo Code sends
effort: "xhigh"without a thinking budget, so thinking can use most of the limit.The user also cannot work around it: with reasoning enabled, the "Max Output Tokens" slider stops at 16,384 on Bedrock, while the direct Anthropic provider allows up to 64k/128k for the same models.
To Reproduce
Steps to reproduce the behavior:
anthropic.claude-opus-4-8, with reasoning enabled.Expected behavior
max_tokensreserves Bedrock quota up front and reduces the context available for the conversation.Screenshots
Video
What version of zoo are you running
3.82.1
Additional context
messageStopevents are skipped without readingstopReasonin the Bedrock stream loop (src/api/providers/bedrock.ts).packages/types/src/providers/bedrock.ts,maxTokensis8192for Claude Sonnet 4.5/4.6/5 and Opus 4.7/4.8/5, versus64_000/128_000inpackages/types/src/providers/anthropic.ts. With reasoning enabled, the slider maximum ismax(model maxTokens, 16_384), hence 16,384 on Bedrock. AWS documents 64K max output tokens for Claude Sonnet 4.5: https://docs.aws.amazon.com/bedrock/latest/userguide/model-card-anthropic-claude-sonnet-4-5.htmlinput + max_tokensfrom the tokens-per-minute quota at request start (https://docs.aws.amazon.com/bedrock/latest/userguide/quotas-token-burndown.html), and Zoo Code reservesmax_tokensfrom the context window (src/core/context-management/index.ts).