Files
opencode2api/internal
sk-dev-ai 406107b053 fix: report header-phase client disconnects as 499 client_canceled, not 502
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.
2026-10-14 17:26:33 +05:30
..