monater (Discord, #general): an OpenAI-format custom provider answered
gpt-6.1-sol with HTTP 200 carrying "Rate limit reached for gpt-6.1-sol
... on tokens per min (TPM) ... Please try again in 6ms." failure(200, …)
skipped every 429 case and fell to `status < 500 && usedUpWords`
("limit reached"), so the try failed as quota and rested 15 minutes,
shown as "200 quota used up". The same text as a real 429 has been a
rate limit since v0.1.1748.
One classifier: carriedStatus maps a 2xx/3xx body through streamStatus,
the reading already used for an error inside a stream, in failure,
failureOf and restAfterMarked. Words streamStatus doesn't know (its 502)
keep the 200 and read as before. insufficient_quota maps to 402 and
stays credit, as at 429.
Siblings:
- non-streamed 200 whose body is only an error (OpenAI/Gemini
{"error":…}, Anthropic type:error, a failed Responses object):
errorReply, read in holdWriter.settle, fails the try with that status,
so it is retried or handed on instead of going to the agent as an
answer; unheld, the passthrough sniffer books it failed (settleWhole),
so the Requests list shows it red with its words.
- translated route (an Anthropic/Responses/Gemini client to a chat
provider, plugins included): an error event with no status went out as
502 and failed as "other"; it now takes streamStatus's status.
- Streamed passthrough with content then an error (the reporter's path)
is covered by the failureOf/restAfter change.
Not changed: Codex's ChatGPT backend (always streams; its error events
already go through the same failure()), Claude Code's bridgeFailed and
tool_loop's relayStatus (own statuses).
The Requests list needed no change: a row with err is shown failed
(ledFailed_), "200 · <err_type>" with the reason as its tooltip.
Tests (carried_error_test.go, the reporter's literal text): failure and
failureOf at 200 equal 429's for it and for minuteLimitBodies,
restAfter at 200 is a rate limit's minute at 429, errorReply, the
sniffer, and end to end: a chat 200 error body and a Responses failed
object retried as rate and answered, a chat stream with content then
the error resting as rate at 429, and an Anthropic request translated
from a chat stream failing as rate.
Broken by hand: carriedStatus returning the status unchanged turns
the unit, rest and stream tests red (quota, 14m59s, Status 200: the
reported behaviour); errorReply off in settle turns both retried-body
tests red (the error went to the agent as a 200); translate back to
502 turns the translated test red ("other"); settleWhole a no-op
turns the sniffer test red.
Run (mote): go test -tags nogui -timeout 45m ./... at d8c70504d plus
this change: EXIT 0, 76 packages ok, internal/gateway 660s. Rebased on
origin/main (no gateway change in between); the new tests and gofmt -l
again at the pushed head. GOOS=linux and GOOS=windows go vet
./internal/gateway ok.
Not tried: a real relay answering 200 with this error; no GUI test run
(no GUI change).