Skip to content

V2 Bedrock: sessions silently die mid-turn (opus 5.5 and fable 5.1 confirmed) #51063

Closed

Description

@asaf-agami-cyera

Description

The maxTokens value is omitted, so Bedrock defaults to 4096. In Claude Code the value is 128,000 for Opus 5.5, and 64.000 for Fable 5.1.

When Claude models think for more than 4k tokens, the turn ends without any answer, error or retry. Usually in the middle of a thinking block.

A workaround is to add this to opencode.jsonc:

  "providers": {
    "amazon-bedrock": {
      "models": {
        "global.anthropic.claude-fable-5-1": {
          "body": {
            "inferenceConfig": {
              "maxTokens": 64000,
            },
          },
        },
        "global.anthropic.claude-opus-5-5": {
          "body": {
            "inferenceConfig": {
              "maxTokens": 128000,
            },
          },
        },
      },
    },
  },
  • Confirmed with Fable 5.1 and Opus 5.5, could be more models through Bedrock.
  • Only tested in V2

Plugins

No response

OpenCode version

No response

Steps to reproduce

No response

Screenshot and/or share link

No response

Operating System

No response

Terminal

No response

Activity

  1. rekram1-node commented on Sep 25, 2026

    @rekram1-node
    Collaborator

    yeah it has to do with max tokens fixing today

  2. opencode-agent commented on Sep 27, 2026

    @opencode-agent
    Contributor

    Fix merged into v2 in #51271. It landed after v2.0.18 and will be included in the next V2 release, v2.0.19. The output-token limit is now supplied to Bedrock Converse requests, preventing the omitted-maxTokens 4,096-token default described here.

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

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions