fix: normalize null Responses input content#4626
fix: normalize null Responses input content#4626u-wlkjyy wants to merge 2 commits intoQuantumNous:mainfrom
Conversation
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (2)
🚧 Files skipped from review as they are similar to previous changes (1)
WalkthroughAdds OpenAIResponsesRequest.NormalizeInputNullContent() to rewrite message-like ChangesResponses API Null Content Normalization
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~20 minutes Possibly related PRs
Suggested reviewers
Poem
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
Tip 💬 Introducing Slack Agent: The best way for teams to turn conversations into code.Slack Agent is built on CodeRabbit's deep understanding of your code, so your team can collaborate across the entire SDLC without losing context.
Built for teams:
One agent for your entire SDLC. Right inside Slack. 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 |
|
trea cn调用会存在这个问题 |
Important
📝 变更描述 / Description
Some OpenAI-compatible clients can send empty assistant messages as
content: null. When these requests are converted to, or directly sent through, the Responses API path, Responses-compatible upstreams reject them because each input item'scontentmust be a string or an array.This change normalizes explicit
nullcontent on Responses input items to an empty string before the request is sent upstream. It is applied both to native/v1/responsesrequests and to the/v1/chat/completionsto/v1/responsescompatibility conversion path.🚀 变更类型 / Type of change
🔗 关联任务 / Related Issue
✅ 提交前检查项 / Checklist
Bug fix,我已提交或关联对应 Issue,且不会将设计取舍、预期不一致或理解偏差直接归类为 bug。📸 运行证明 / Proof of Work
Relevant test passed:
I also attempted broader local test commands. They are currently blocked in this workspace by unrelated existing/local issues:
A targeted relay command also reaches unrelated existing failures in Claude and stream scanner tests, outside the files changed by this PR.
Summary by CodeRabbit
Bug Fixes
Tests