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 it was answered with 502 upstream_error on both the message endpoints and System One. Check wire.ClientCanceled before the generic 502 and answer 499 client_canceled instead; an exhausted request budget keeps its 504. Cancels log at debug before the request_failed warning, so disconnects no longer read as upstream outages. Co-authored-by: sk-dev-ai <githubkrishsk@gmail.com>