Commit Graph
1 Commits
Author SHA1 Message Date
yetoneandggbdpq 26a6461b14 gateway: a gateway key's 403 names the model it was checked on, not the one sent (#4175)
Claude Desktop's gateway check, and any request magpie moves onto
another model before the key check (a stand-in, a tier, a privacy
move), was refused in the name of the model the client sent: "may not
use claude-haiku-4-5", a model the key was never checked against, while
the check failed on the first model of Desktop's list. The message now
names what was checked: a group by its ref, a model as provider/model.

Changed from the contributor's patch: a model is named as the
provider/model the check judged rather than `asked`, which a privacy
move doesn't update.

Not changed: the probe still lands on Desktop's first listed model, so a
key that can't use it still fails Desktop's check; whether the probe
should fall back to a model the key may use is left open on #4175.

Run (mote): go test -tags nogui -run 'TestClaudeDesktopProbeRefusal'
./internal/gateway/ ok; the whole internal/gateway package ok (926s) on these changes over 4e7661adc, the targeted tests again at this head, rebased onto b712adb84; vet and gofmt clean.
Broken by hand: keyModelError given call.Model again, both new tests
fail ("may not use claude-opus-4-6").
Not tried: a real Claude Desktop sign-in.

Co-authored-by: ggbdpq <ggbdpq@gmail.com>
2026-11-06 10:44:24 +08:00