mycf_711's wps-lingxi rows read status=200: the plugin's stream already
sent its 200, then wrote {"error":{"message":"灵犀上游返回 AIError:
AI服务异常(上游暂时不可用,可重试)(HTTP 503)",...}}. On main a frame
mid-reply was booked at 200 and rested 60s as "other" with the error
"OK: ...", and one as the first event failed at the 502 the words'
guess gives. Routing never saw the 503 (or AuditFailed's 502).
Now the status an error frame names is what it fails, rests and is
booked at:
- a numeric status or code member, 400-599 (skygunner's patch: held
stream's errOf, errorReply, carriedStatus, and the sniffer's note on
the try's header for a reply already streaming, kept from the client);
- else "(HTTP 503)" / "(HTTP 503)" in the words, 429 and 5xx only, as a
quoted 4xx ("the image link answered (HTTP 404)") may not be the
provider's;
- a mid-reply call is booked at that status in Routing and Usage.
A quoted string code ("429", "1113") is the vendor's own code, not a
status. Words magpie wrote itself (loop guard, empty reply, relooped)
and too-long words name nothing, whatever members they carry: a LAN
peer's loop guard frame carries 502 in its Gemini shape. Such a frame
also no longer rests the route mid-reply (main rested it 60s as
"other" at 200); the model looping is not the provider failing.
Left out of skygunner's patch: streamFailure giving magpie's own Chat
frames a code and status. A peer magpie would read its loop guard frame
as a named 502.
Run (mote, at a1f1810e9 + this change):
- go test -count=1 -run 'TestRelayStreamErrorFrame|TestNamedStatusOf|
TestGeminiCompat|TestLoop|Stream|Late|Carried|ErrorReply|Rest'
./internal/gateway: first run red on TestNamedStatusOf (a quoted
"429" read as a status through json.Number), fixed. At this commit
(on 8a8079680; d02b8a000 under it since changes the GUI only), the same -run with
|Refus|Fallback added: ok (222s); go vet ./internal/gateway on
darwin, GOOS=linux and GOOS=windows: clean; gofmt -l: nothing.
- The new tests at a1f1810e9 without the change: every subtest of
TestRelayStreamErrorFrameSaysItsStatus and
TestRelayStreamErrorFrameNamesItsStatusInWords red except the 4xx
quoted case (mid-reply rested at 200, first event booked at 502,
the peer's loop guard rested).
Broken by hand:
- namedStatusOf without textStatus: first_event and TestNamedStatusOf
red.
- magpieSaid returning false: the peer loop guard subtest and
TestNamedStatusOf red.
Not tried: a real wps-lingxi account; the full suite (runs after the
push). AuditFailed (the plugin's "audit_blocked") is counted as the 502
it names, not as a refusal of the request's content; whether a content
refusal there should rest nobody was not checked.
Co-authored-by: vincent <vincent@users.noreply.github.com>
Co-authored-by: MYCF711 <323101370+MYCF711@users.noreply.github.com>