-
Notifications
You must be signed in to change notification settings - Fork 3
Description
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-6claude-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
thinking,output_config, andcontext_managementfields should be passed through to Anthropic- Thinking blocks should appear in responses when using Opus 4.6 with adaptive thinking
- JSON schema output format should return properly structured JSON, not markdown text
References
- Anthropic Adaptive Thinking docs
- Anthropic SDK Go v1.21.0: https://github.com/anthropics/anthropic-sdk-go/releases/tag/v1.21.0
Created on behalf of @banasmat