mirror of
https://github.com/jasonxu114514/opencode2api.git
synced 2026-12-05 08:02:53 +00:00
A downstream disconnect during the upstream attempt loop is not an upstream failure, but the gateway answered it with 502 upstream_error on both the message endpoints and System One. Clients that retry on 502 then retried a request nobody cancelled, and telemetry counted a client behavior as a server failure. Check wire.ClientCanceled before the generic 502: set meta.Outcome so the request line reads client_canceled, and answer 499 with a client_canceled envelope. DeadlineExceeded keeps its 504.