Repository navigation
Force adaptive thinking for Pi Anthropic routes - #175
Conversation
There was a problem hiding this comment.
🟡 Changes recommended
The unconditional override breaks thinking-enabled requests to older Anthropic models that require token-budget thinking.
1 open issue
What changed in this PR
Updates Pi’s generated configuration to use adaptive thinking for Anthropic Messages routes, addressing newer models’ request requirements.
Changes:
- Adds
compat.forceAdaptiveThinking: trueto Anthropic model configs. - Updates the native-API test to expect the flag.
| File | Description |
|---|---|
| internal/harness/pi.go | Forces adaptive thinking for Anthropic routes. |
| internal/harness/harness_test.go | Verifies the generated compatibility flag. |
Review effort: Balanced
| // Pi's Anthropic client appends /v1/messages itself. | ||
| model["api"], model["baseUrl"] = "anthropic-messages", baseURL | ||
| // Anthropic Messages models use adaptive thinking, not a token budget. | ||
| model["compat"] = map[string]any{"forceAdaptiveThinking": true} |
There was a problem hiding this comment.
I haven't verified this claim, but @ShivainVij I wonder if this is true? It's up to us whether we want to have some hardcoded list in the CLI, but it does seem like we would break any old model usage
There was a problem hiding this comment.
This is true, old models would break. Is support for 4.5 models needed still?
There was a problem hiding this comment.
This is true, old models would break. Is support for 4.5 models needed still?
Nobody has explicitly told us that they need older models + Pi, but I doubt that's something that would organically come up. Though it's unlikely, would be a bummer if this broke for somebody. It seems relatively easy to fix with low risk, but I'll defer to you
cretz
left a comment
There was a problem hiding this comment.
If we can have e2e tests that will catch this break, that would be ideal

Anthropic Messages routes now always set
compat.forceAdaptiveThinking: truein Pi’s generated model config. This prevents Pi from sending the legacythinking.type.enabledrequest shape to Anthropic models such as Claude Opus 5.5, which require adaptive thinking.Tested with a fresh Pi teardown/setup and a successful Opus 5.5 request.
Context: https://platform.claude.com/docs/en/build-with-claude/extended-thinking#migrating-to-adaptive-thinking
Validation:
go test ./internal/harness