Files
magpie/docs
ggbdpqandfactory-droid[bot] d81706f974 gateway: a Chat or Responses client's xhigh on Claude Opus 4.7 and later, Sonnet 5 and later or Haiku 5.5 goes as xhigh, not max
buildAnthropic asked every Claude that thinks only adaptively for max
when the client asked xhigh, on the grounds that 4.6 has no xhigh. Only
Opus and Sonnet 4.6 lack it: Anthropic's effort docs list xhigh on
Fable 5 and 5.1, Mythos 5 and 5.1, Opus 5.5, 5, 4.8 and 4.7, Sonnet 5.5
and 5, and Haiku 5.5, and describe max as no constraint on token
spending. So Codex, Cursor or any Chat client picking xhigh on
claude-opus-5-5 was billed for max. Claude Code's own levels in magpie
(claudeEffortsFor) already say only Opus and Sonnet 4.6 skip xhigh.

Now xhigh becomes max only on 4.6 (noXhigh, which reads the version
through claudeVersionOf, shared with adaptiveOnly). A relayed thinking
budget is unchanged: budgetOf gives xhigh and max the same budget, and
31999 is Claude Code's old ultrathink, so a budget above high still
goes as max. docs/subsystems/gateway-routing.md now says which models
are asked adaptively (#1470) and where xhigh stays xhigh.

What was run: TestXhighStaysXhighWhereClaudeTakesIt (Chat and Responses
through the server stack to a fake Anthropic upstream) fails on the old
main with output_config = map[effort:max], want "xhigh" for Opus 5.5
(Chat and Responses), Opus 4.7, Sonnet 5 and Haiku 5.5, and passes with
the change; Opus and Sonnet 4.6 get max before and after, and a Fable
5.1 row asserts xhigh. TestAdaptiveThinking's Opus 5.5 xhigh case now
asserts xhigh, beside a 4.6 case asserting max. Broken by hand (noXhigh
always false) the 4.6 cases fail. gofmt -l prints nothing; go vet -tags
nogui ./... passes for darwin, linux and windows; go test -tags nogui
-count=1 ./... under a temp HOME passes. Through the aihubmix relay,
claude-opus-5-5 with adaptive thinking and effort xhigh answers 200.
Not tried against Anthropic directly (no credential outside the
keychain); a relay that checks effort against an older list could still
refuse xhigh.

Reported and fixed by ggbdpq (#1471).

Co-authored-by: factory-droid[bot] <138933559+factory-droid[bot]@users.noreply.github.com>
2026-10-10 15:17:13 +08:00
..