Files
magpie/docs
yetone d4244d5c19 gateway: a thinking budget the provider's Extra body adds is sent to Opus 5.5 as adaptive thinking, as an agent's is
forwardOnce turned a thinking budget into adaptive thinking for a Claude
that takes no budget (adaptiveThinking), then merged the provider's Extra
body (#1604). A budget written there, {"thinking":{"type":"enabled",
"budget_tokens":2048}}, went to claude-opus-5-5 as written, and Anthropic
answers that with 400. When the Extra body changed an Anthropic body, it
is fitted again (adaptiveThinking, then withoutRefusedShapes for the
display), so it goes as the agent's budget does. Found while looking into
(rc.44), not this.

TestExtraBodyBudgetFittedToAdaptiveModel: a fake that refuses
thinking.type enabled with Anthropic's words, Extra body with a budget,
a client sending no thinking. Broken by hand: with gateway.go reverted it
fails with that 400; with the fix, one request, thinking
{"display":"summarized","type":"adaptive"} and an effort.

Run at this head (rebased on origin/main 95e7c6bcc): gofmt -l clean;
go vet -tags nogui ./internal/gateway for darwin, linux and windows clean;
go test -count=1 ./internal/gateway ok (sandbox HOME). No real Claude API
call was made.
Full suite: SUITE_LINE
2026-10-15 23:08:00 +08:00
..