fix: normalize missing Responses output item collections - #7088
fix: normalize missing Responses output item collections#7088DoubleMice wants to merge 1 commit into
Conversation
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Plus Run ID: 📒 Files selected for processing (2)
Included review availability: Your plan provides up to 10 included reviews per hour; 9 remain after this review. WalkthroughThe Responses SSE relay now adds missing empty ChangesResponses SSE normalization
Estimated code review effort: 3 (Moderate) | ~20 minutes Merge Risk: ⚪ Minimal · up to The relay now adds required empty collections to affected reasoning and message streaming items while preserving existing data and event ordering, preventing compatible clients from dropping those items. No actionable merge-blocking risk remains after normal checks and review. Suggested reviewers: Poem
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
Full details: Linked Issues checkExplanation The changes satisfy issue
✨ Finishing Touches🧪 Generate unit tests (beta)
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 |
51fdfc5 to
2b6f1df
Compare
Important
📝 变更描述 / Description
部分 Responses 上游在
response.output_item.added阶段会省略尚为空的集合字段:reasoning item 缺少summary,message item 缺少content。严格按 OpenAI Responses item schema 反序列化的客户端会丢弃该 added item,后续 reasoning/text delta 因此无法关联 active item。本 PR 在原生 Responses SSE 转发前做最小规范化:仅针对缺失字段补充
summary: []或content: []。已有字段、其他 item 类型及事件中的sequence_number等数据保持不变。本 PR 的代码和测试由 AI 辅助生成;提交者已审阅实现、确认协议行为,并完成本地与生产环境验证。
🚀 变更类型 / Type of change
🔗 关联任务 / Related Issue
✅ 提交前检查项 / Checklist
Bug fix,我已提交或关联对应 Issue,且不会将设计取舍、预期不一致或理解偏差直接归类为 bug。📸 运行证明 / Proof of Work
修复前捕获到的上游事件:
{"type":"response.output_item.added","output_index":0,"item":{"id":"rs_1","type":"reasoning","status":"in_progress"},"sequence_number":2} {"type":"response.output_item.added","output_index":1,"item":{"id":"msg_1","type":"message","role":"assistant","status":"in_progress"},"sequence_number":3}修复后使用 OpenAI Codex 验证,
ReasoningSummaryPartAdded/ReasoningSummaryDelta/OutputTextDelta without active item均消失,普通 streaming、reasoning 与 shell tool call 正常。测试结果:
Summary by CodeRabbit
Bug Fixes
Tests