feat: add SSE passthrough stream action
This commit is contained in:
@@ -24,6 +24,7 @@
|
||||
- 上游若返回明确的容量错误(默认匹配错误文案 `Selected model is at capacity. Please try a different model.`、`stream disconnected before completion: Concurrency limit exceeded for account, please retry later`,以及 Responses 错误码 `server_is_overloaded` / `slow_down`),也会自动重试;重试耗尽后转成本地 `502`
|
||||
- 除了 `429/503` JSON 错误响应,也会识别 `200` 但返回体本质是错误、以及流式失败事件里携带同样文案的情况
|
||||
- 流式命中时默认先缓存并判断;一旦命中 `516`,统一返回 `502`
|
||||
- 可选 `passthrough` 直通模式会对 `stream: true` 请求跳过 reasoning retry;若上游实际返回 `text/event-stream`,则把原始 SSE chunk 直接转发给客户端,不解析、缓存、规范化或拦截
|
||||
- 流式成功响应在严格检查模式下仍会先缓存完成;成功后会按真实且规范化的 Responses 生命周期与输出顺序逐块回放给 Codex,每个 SSE 块之间至少间隔 5ms,并关闭 TCP 小包聚合,避免大量 delta 在同一事件循环突发到达;不会伪造缺少 response ID 的生命周期事件
|
||||
- 默认同时拦截 root 路径和 `/v1` 路径:
|
||||
- `/responses`
|
||||
@@ -388,6 +389,7 @@ macOS / Linux: ~/.codex-retry-gateway/config/config.json
|
||||
- 默认 `strict_502`
|
||||
- `strict_502`:先缓存整个流,命中 `516` 时统一返回 `502`
|
||||
- `disconnect`:兼容旧行为;若命中发生在已透传 chunk 之后,则直接断开连接
|
||||
- `passthrough`:对 `stream: true` 请求关闭 reasoning retry;只有上游实际返回 `text/event-stream` 时原样转发 SSE chunk,非 SSE 响应继续按单次既有规则处理
|
||||
- `log_match`
|
||||
- 是否记录命中日志
|
||||
|
||||
|
||||
Reference in New Issue
Block a user