mirror of
https://github.com/zyycn/codex-proxy-rs.git
synced 2026-11-06 16:06:08 +00:00
* fix(gateway-api): translate upstream WebSocket error events into SSE response.failed WS 上游协议用 `error` 事件报告流中途失败(如 OpenAI 的 server_is_overloaded), SSE 协议的对应形态是 `response.failed`。SSE 交付边界此前把 `error` 事件按 未知事件原样透传,而 codex 等 SSE 客户端会静默忽略未知事件类型:客户端只看到 无原因的流 EOF("stream closed before response.completed"),丢失了上游的 完整错误负载(message/code/type),也无法据此分类重试。 现在 SSE 编码器在交付边界把 `error` wire 事件翻译成 `response.failed`: 错误负载(type/code/message/param)原样保留,response id 沿用已交付的 response.created。WS 客户端交付不变(WS 协议原生支持 error 帧)。 原有的会话级失败兜底(finish_with_gateway_error 合成 response.failed)不变。 * fix(gateway-api): preserve upstream response failures Co-authored-by: Codex <noreply@openai.com> --------- Co-authored-by: Zyy <zyycn@users.noreply.github.com> Co-authored-by: Codex <noreply@openai.com>