#2077: server B used server A's magpie as a Remote magpie provider. A's
Claude Code hit its session limit and answered 429; B rested its one
key to A until the reset, so a request for A's Qoder model was refused
on B with Claude Code's 429 ("... (out of its allowance: not asked
again before 10:55)") and never asked of A.
caa536733 (bigsteven on Discord) landed the same fix while this was
being written: remoteModelRest rests only the model on a remote's
quota, credit or rate refusal. This adds what it left:
- A's refusal of the key itself (keyLimited's 429 for the gateway key's
own budget) refuses every model alike, so it still rests the whole
remote. keyLimited now marks it with X-Magpie-Limit-Reset
(remoteKeyLimitHeader), and remoteModelRest takes the response header.
- TestRemoteMagpieRestsTheModel: the reporter's case end to end, a
real gateway handler as A over HTTP with a Claude Code provider
answering the reporter's 429 and a Qoder one answering 200, a Remote
magpie on B fetched from it. Qoder answers after Claude Code's 429,
and Claude Code is then held on B without asking A. On the code
before caa536733 it failed with the reporter's exact text.
- TestRemoteMagpieKeyLimitRestsTheKey: goes red with the header check
taken out (checked by hand).
Run:
- gofmt -l clean; go vet ./internal/gateway on darwin (nogui),
GOOS=linux -tags nogui, GOOS=windows.
- go test -tags nogui ./internal/gateway -run
'Rest|Rate|Quota|Remote|KeyLimit|Fallback|Held' on the rebased tree:
ok. The whole package (go test -tags nogui ./internal/gateway, 1939s
under load) was green on this change before rebasing onto
caa536733; not rerun whole after.
Not tried: two built magpie binaries on two machines, or a real Claude
Code account out of its limit.