Skip to content

aibridge: Bedrock Opus 4.5 rejects output_config.effort values 'xhigh' and 'max' #25356

@dannykopping

Description

@dannykopping

Bedrock's output_config.effort field on Claude Opus 4.5 (gated by the effort-2025-11-24 Anthropic-Beta flag) only accepts the enum values low, medium, and high. The upstream Anthropic Messages API enum also includes xhigh and max. When a client request carries one of the unaccepted values and AI Bridge keeps output_config for the request, Bedrock returns a 400:

{"message":"output_config.effort: Input should be 'low', 'medium' or 'high'"}

Pre-existing on main. Reproduces by sending output_config: {effort: "max"} to an Opus 4.5 Bedrock route with the effort-2025-11-24 beta flag set.

Related to coder/aibridge#280 (Opus 4.7+ adaptive-only thinking), addressed in #25335. That PR does not cover this enum drift — it only touches the adaptive-only path; Opus 4.5 reaches Bedrock via the existing beta-flag-gated output_config exemption in removeUnsupportedBedrockFields.

Suggested fix

When forwarding output_config.effort to Bedrock, clamp values not in the model's accepted set. For Opus 4.5: xhigh and maxhigh. Should be model-aware in case other Bedrock models accept different subsets.

Out of scope for this fix

The whole Bedrock-shape adaptation block in aibridge/intercept/messages is flagged as temporary — a planned native Bedrock provider removes the enum-drift problem entirely.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions