fix: 移除 responses/compact 端点的 API type 白名单限制 - #6462
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 (1)
💤 Files with no reviewable changes (1)
WalkthroughThe compact Responses relay path no longer applies an early API type allowlist. Requests proceed to request construction and downstream parsing, model mapping, upstream adaptation, and response handling. ChangesCompact Responses relay
Estimated code review effort: 2 (Simple) | ~5 minutes Poem
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ 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 |
|
这个删了会无法编译通过,需要清理一下import |
e16203f to
fe197c3
Compare
fe197c3 to
cec2e64
Compare
@seefs001 已本地测试编译通过 |
Important
📝 变更描述 / Description
移除
relay/responses_handler.go中/v1/responses/compact端点的 API type 白名单(仅允许 OpenAI/Codex 通过)。该白名单与适配器层校验完全重叠——不支持 Responses 的适配器会在
ConvertOpenAIResponsesRequest中自行报错,白名单只是把更精准的适配器错误替换成了笼统的
"unsupported endpoint for api type X"。AdvancedCustom 适配器已完整实现 Responses 处理链,却被白名单拦截在适配器之前,属于遗漏。
删除后,AdvancedCustom 渠道在
converter=none模式下可正常使用 compact 端点,其他不支持的适配器仍会自然报错,行为不变。下游 compact 逻辑(后缀处理、定价 fallback、计费)本身不区分 API type,无需联动修改。
🚀 变更类型 / Type of change
🔗 关联任务 / Related Issue
/v1/responses/compact端点兼容问题 #6461✅ 提交前检查项 / Checklist
Bug fix,我已提交或关联对应 Issue,且不会将设计取舍、预期不一致或理解偏差直接归类为 bug。📸 运行证明 / Proof of Work
(请在此粘贴截图、关键日志或测试报告,以证明变更生效)
Summary by CodeRabbit