What changed: qoderFailure (internal/gateway/qoder.go) read every 401/403
as "Qoder: the sign-in lapsed — sign in again". It now reads Qoder's own
code first, whatever the HTTP status, the way Qoder.app's client does
(the QoderErrorCode table in its qoder-agent-sdk worker,
qoder-worker-runtime.obf.mjs) and as @magpie-community/opencode-qoder-auth
0.2.14 does (plugins f573cfd):
- 10605, or a queue state (in "queue" or in the message as JSON) with
isQueued true or serviceAvailable false: 503 "Qoder is busy for
<model> (this plan's queue: <tier>); try again in <n>s", with
Retry-After from retryAfterSeconds rounded up (30s when absent).
- 110, 112-119, 122 (usage or credits used up): 429.
- 406, 416, 430, 80411, 80412, 100400, 100401, 100403 (refusals of the
request; Qoder's table has no 100402): 400 with Qoder's words.
- 105 or no code on a 401/403: the 401 "sign in again" as before.
Both the HTTP status path (askQoder) and the in-stream statusCodeValue
path (decodeQoder) go through it. Event gets a Wait field for a KError,
and relayStatus's fail and serveQoder's first-round failure send it as
Retry-After (retryAfterOn); askQoderWait is askQoder that also returns
the wait, and askQoder (the round searchRounds uses) wraps it. Zed and
Command Code share relayStatus and never set Wait, so they are
unchanged.
Why: a real Qoder trial account had every chat answered
403 {"code":"10605",...} (Qoder's model queue) and was told to sign in
again, which can't help. The plugin was fixed in 0.2.14 for moved users;
this is the same fix for users still signed in through the built-in. The
built-in never marked an account lapsed from a refused chat (only from a
refused refresh, provider/qoder.go), and now a 10605 doesn't even return
the 401: the gateway's busy() reads the 503 as busy (failOther), so a
group asks it again after the pause, no shorter than its Retry-After
(noteBusy/retryAfter), and the agent gets the Retry-After too.
Run:
- New tests in internal/gateway/qoder_busy_test.go, the fixture
testdata/qoder_queued_10605.json taken byte for byte from plugins #98:
TestQoderQueuedIsBusy (serveQoder, HTTP 403 and in-stream 403, stream
and not: 503, Retry-After 30, the busy words, no "sign in", busy() true,
retryAfter 30s), TestQoderQueueWait, TestQoderErrorCodes. With the old
401/403 rule put back at the top of qoderFailure all three FAIL
("got 401 ... want 503"); with retryAfterOn made a no-op
TestQoderQueuedIsBusy FAILs on Retry-After "" in both subtests. Restored,
they pass.
- go test -tags nogui ./internal/provider ok (458s). go test -tags nogui
-timeout 40m ./internal/gateway (the default 10m ran out under the
machine's load): every test passed except TestCodexHeardWithinItsIdleTimeout,
which failed with the body #1800 already describes (Codex got member
a's server_is_overloaded under load); it passes 10 of 10 alone
(-count=10) and is on the Codex passthrough path, which this doesn't
touch. Noted on #1800.
- gofmt -l clean; go vet ./..., GOOS=linux go vet -tags nogui ./...,
GOOS=windows go vet ./... ok; go build, GOOS=linux go build -tags nogui,
GOOS=windows go build ok.
- Not run: the rest of go test ./... (only the two packages touched);
a real 10605 through the built-in (the queue had reopened when the
plugin shipped); no Qoder parity test exists in
internal/gateway/plugin_*_test.go to extend.
2 lines
182 B
JSON
2 lines
182 B
JSON
{"code":"10605","message":"{\"isQueued\":false,\"modelKey\":\"efficient\",\"queueCount\":0,\"queueType\":\"p3\",\"retryAfterSeconds\":30,\"serviceAvailable\":false,\"waitTime\":0}"}
|