Repository navigation
fix(gateway): handle Codex WebSocket interruption and continuation - #837
Closed
zhaoxinbeizhucele wants to merge 1 commit into
Closed
zhaoxinbeizhucele wants to merge 1 commit into
zhaoxinbeizhucele wants to merge 1 commit into
Conversation
Owner
|
感谢详细的排查,已在 #838 修复并合并,这个 PR 就先关闭了。 在首个输出前中断会断开连接的问题,已提交上游修复,会另行跟进。 |
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.
关联 Issue / Related Issue
No linked issue.
变更内容 / Change Content
Codex clients send
response.interruptduring an active Responses WebSocket generation. GPT-Load currently queues it as a create request and rejects it withinvalid_protocol_requestbefore it reaches the upstream.This fix is limited to the Codex subscription path:
InterruptExecutionSessionAPI.response.interrupt.failedas a nonterminal control result, allowing the original response to continue.response.incompletewith reasoninterruptedas a normal interrupted terminal, preserve the original event and usage, and permit continuation. Other incomplete reasons keep their existing handling.The control does not create a second generation request, synthesize completion or usage, switch credentials, or replay input. Duplicate and already-finished controls are ignored. Regression tests cover target validation, forwarding during generation, upstream rejection, interrupted termination, usage and next-turn reuse.
Both Go modules upgrade the official
github.com/router-for-me/CLIProxyAPI/v8dependency from v8.0.8 to v8.0.22 for its existing interruption API. There is no personal-fork replacement or vendored core. No README, native/API-key interruption, diagnostic logging, database migration, UI or configuration changes are included.Known limitations / draft status
This PR is a draft for review, not a claim that the candidate is ready to release:
terminal_empty_incompleteand invalidate the connection when interruption occurs before any output. The gateway accepts the interrupted terminal, but its mock-session test does not prove that CPA delivers this boundary successfully. The real CPA transport test covers accepted interruption after output and unsupported interruption. No separate dependency PR or fork is required by this candidate.TestAntigravityExecutionOnlyBridgeConvertsDeclaredStreamingProtocolsfails in four protocol subtests with empty stream output. The original v8.0.8 baseline passes; the pre-ablation v8.0.22 candidate also fails. This dependency-upgrade regression remains unresolved and needs assessment before merge.Validation
Rechecked on the submitted commit:
Earlier validation of this same candidate passed gateway tests except the Windows-sensitive
TestBufferedWriteDeadlineStopsRealTCPSlowReader, dialect/CPA execution/native session/Codex provider tests, dependency-version alignment, root and embeddedgo mod tidy -diffandgo vet ./..., and root build. The full embedded suite has the failure described above.Full
make check, Linux acceptance and race checks have not been completed on this Windows workstation. Earlier broad checks encountered Unix path/permission assumptions and unavailable Docker/Bash tooling. The candidate has not been deployed or manually accepted; live testing of the earlier emergency implementation is not presented as acceptance of this refactor.Manual acceptance: in a client using a Codex subscription group, interrupt after output starts, then send another message in the same session. Expect no gateway
invalid_protocol_request, retained actual usage and a successful next turn. If the upstream rejects interruption, expect its control failure event followed by normal completion of the original response. Invalid or foreign response IDs/lane targets must be rejected. Before-first-output interruption remains a known dependency limitation.自查清单 / Checklist
make check,或在说明中写明无法运行的原因和未验证范围。 / I ranmake check, or documented why it could not run and what remains unverified.README changes are deliberately excluded from this focused bug-fix candidate; compatibility and limitations are documented here.