Skip to content

Claude Opus 4.6 support: thinking configuration and JSON schema responses not working #177

@blinkagent

Description

@blinkagent

Summary

Claude Opus 4.6 introduced adaptive thinking, but AI Bridge is currently stripping the thinking configuration when relaying requests to Anthropic. Additionally, there are issues with structured JSON schema outputs.

Issues Identified

1. Thinking configuration is stripped

Clients send the thinking configuration to AI Bridge, but it gets stripped before being forwarded to Anthropic:

"thinking": {
    "type": "adaptive"
},
"output_config": {
    "effort": "max"
}

The context_management field is also being stripped:

"context_management": {
    "edits": [
        {
            "keep": "all",
            "type": "clear_thinking_20251015"
        }
    ]
}

This prevents thinking blocks from appearing in responses for Opus 4.6 (whereas Opus 4.5 shows them normally).

2. JSON schema output format not being respected

When using output_format with json_schema type, Anthropic returns the structured JSON directly, but AI Bridge returns a text response instead:

Request:

"output_format": {
    "type": "json_schema",
    "schema": { ... }
}

AI Bridge response: Returns text with markdown formatting instead of raw JSON

Direct Anthropic response: Returns properly formatted JSON string

This causes "No object generated: could not parse the response" errors in name generation and similar use cases.

Affected Models

  • claude-opus-4-6
  • claude-haiku-4-5 (JSON schema issue)

Root Cause Investigation

The Anthropic Go SDK was checked (v1.21.0 includes output_config support), but upgrading alone did not resolve the issue. The thinking and related fields appear to be stripped during request marshaling/relaying in AI Bridge.

Expected Behavior

  1. thinking, output_config, and context_management fields should be passed through to Anthropic
  2. Thinking blocks should appear in responses when using Opus 4.6 with adaptive thinking
  3. JSON schema output format should return properly structured JSON, not markdown text

References


Created on behalf of @banasmat

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions