Skip to content

[BUG] Bedrock: responses cut at the output token limit end with an unrelated error, and the limit cannot be raised #1668

Description

@LouisClt

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:

  1. Select the Amazon Bedrock provider and anthropic.claude-opus-4-8, with reasoning enabled.
  2. Open the "Max Output Tokens" slider: its maximum is 16,384.
  3. Give a complex task (e.g. a large refactor or a long file to write).
  4. 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

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions