Repository navigation
fix(codex): upgrade SDK and ignore late interrupts - #840
Conversation
📝 WalkthroughWalkthrough将 CLIProxyAPI 依赖版本和 Codex 模型目录中的 CPA SDK 版本从 v8.0.22 更新为 v8.0.23。调整 WebSocket 中断处理:响应已结束时忽略中断,不再发送错误帧;响应不存在或通道不匹配时,仍发送错误帧。更新 CPA 中活动响应 ID 的终态处理,并修改相关中断测试。 Priority: ⬇️ Low Merge Risk: 🔵 Low · up to The late-interrupt test could miss extra same-connection work or accounting activity. Adding explicit assertions is a bounded follow-up; no production regression is established, so the change remains mergeable with this coverage gap noted. 🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)✅ Passed checks (4 passed)Full details: Docstring CoverageExplanation Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 2 functions across 5 files. (2 skipped: 2 unsupported.)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
🧹 Nitpick comments (1)
third_party/cpaembedded/embedded/codex_websocket_interrupt_test.go (1)
228-232: 🎯 Functional Correctness | 🔵 Trivial | ⚡ Quick win为终止事件增加无额外工作的断言。
终止事件回调调用
sender.Interrupt后,测试只检查一次 continuation 请求和connections == 1。connections只能发现新建 WebSocket,不能发现同一连接上的额外推理、RPM 使用或请求日志。测试在收到resp_2后还会忽略下一条消息,因此额外工作可能不会使测试失败。请为上游请求、推理和 RPM 记录增加明确计数,并在终止事件回调返回后断言这些计数没有增加。
ℹ️ Review info
⚙️ Run configuration
- Configuration used: Organization UI
- Review profile: QUIET
- Plan: Advanced
- Run ID:
c72fe709-0787-4bdc-99d8-44e72892ad92
⛔ Files ignored due to path filters (2)
go.sumis excluded by!**/*.sumthird_party/cpaembedded/go.sumis excluded by!**/*.sum
📒 Files selected for processing (7)
go.modinternal/catalog/codex_client_models.gointernal/gateway/websocket_interrupt.gointernal/gateway/websocket_interrupt_test.gothird_party/cpaembedded/embedded/codex_websocket.gothird_party/cpaembedded/embedded/codex_websocket_interrupt_test.gothird_party/cpaembedded/go.mod
Included review availability: This review used your included allowance. Your plan provides up to 8 included reviews per hour; 7 remain after this review.
关联 Issue / Related Issue
Related to router-for-me/CLIProxyAPI#6483.
变更内容 / Change Content
Late or repeated interrupts for a completed response could leave a 400 error frame that Codex reads as the next turn's failure. Upgrade the root and embedded CPA dependencies to v8.0.23 and ignore these interrupts for known completed responses on the same connection, while retaining authentication, response ownership, and lane checks.
Keep the current turn's response ID through terminal delivery so CPA can handle an interrupt arriving before bridge cleanup. Existing regressions now verify that late interrupts preserve continuation without adding inference attempts, RPM usage, or request logs.
Validation:
make checkpassed. The embedded module also passedgo test -count=1 ./...,go vet ./..., andgo mod tidy -diff. Focused version-alignment, gateway interrupt, and embedded continuation tests were rerun before pushing.No data migration is required. The Codex client identity and model snapshot remain unchanged. CPA's separate zero-output
response.incompleteinterruption limitation on the non-steering path remains unresolved; this PR uses the official dependency without an upstream source patch. Validation used mock upstreams, not a live Codex backend.自查清单 / Checklist
make check,或在说明中写明无法运行的原因和未验证范围。 / I ranmake check, or documented why it could not run and what remains unverified.