Skip to content

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

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

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