mirror of
https://github.com/zyycn/codex-proxy-rs.git
synced 2026-11-06 16:06:08 +00:00
When upstream rejects a NewChain request with websocket_connection_limit_reached before the first deliverable event, retry once on a fresh connection and downgrade to HTTP/SSE if the new connection is still limited or the retry preparation fails, matching the official retry semantics. Non-NewChain requests keep the previous behavior of delivering the error frame as-is, and the code is persisted in upstream diagnostics. All pre-delivery fallbacks share one helper that marks the transport decision and wait metrics. Co-authored-by: Codex <noreply@openai.com>