Repository navigation
Conversation
Contributor
Author
|
补充 CI 说明:本 PR 新增的两项 API OpenAI Responses 测试均已通过(metadata 后 overload 保持未提交、首个真实输出时再 flush 元数据)。当前 unit job 的失败来自基线 main 同样存在的 cli-hop-body.test.mjs / convert-cache-shape.test.mjs TTL 断言;main 的 CI run 39520817070 可复现,与本 PR 修改的两个文件无关。其余 kernel/web/worker/arm64 检查均通过。 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
问题
API 上游的 OpenAI Responses 流式路径当前把任意
data:行都视为已经向客户端提交输出。上游通常会先发送response.created、response.queued、response.in_progress、response.metadata或 keepalive;如果随后返回server_is_overloaded/slow_down,请求会被错误标记为 committed,现有 failover 无法安全换号重试。原生 GPT/Codex worker 已有首输出前缓冲,但 API upstream 路径仍存在这个问题。该问题与 Wei-Shaw/sub2api#8139 修复的语义一致。
修改
data:就提交。error/response.failed,返回committed: false,交给现有 failover 换号重试。committed: true,不会进行不安全的重放。测试
created → queued → metadata → overloaded保持未提交、下游零输出的集成测试。output_text.delta到来后按顺序 flush 的集成测试。node --check src/lib/pool/api-protocol.mjs通过。git diff --check通过。