fix(channel-test): honor Responses compatibility policy - #6290
Conversation
WalkthroughChannel test endpoint normalization now applies the global Responses compatibility policy for matching channel and model combinations. Unit tests cover matching and non-matching policy inputs, global-state cleanup, and preservation of explicitly supplied endpoints. ChangesChannel test endpoint selection
Estimated code review effort: 2 (Simple) | ~10 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 |
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@controller/channel_test_endpoint_test.go`:
- Around line 10-55: Replace the non-fatal value assertions in
TestNormalizeChannelTestEndpointUsesResponsesCompatibilityPolicy and
TestNormalizeChannelTestEndpointKeepsExplicitEndpoint with testify/assert
equivalents, updating the import accordingly; reserve require for setup or fatal
assertions only.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Organization UI
Review profile: CHILL
Plan: Pro
Run ID: 8e0c5346-39de-4f12-8167-ddebfec7ddfe
📒 Files selected for processing (2)
controller/channel-test.gocontroller/channel_test_endpoint_test.go
51fdfc5 to
2b6f1df
Compare
Important
Note
AI-assisted disclosure: 此实现和初始 PR 草稿由 OpenAI Codex 在仓库所有者请求下协助完成;仓库所有者已人工确认变更内容和影响范围。
📝 变更描述 / Description
渠道测试在未显式选择 endpoint 时,会处理 Compact 模型和 Codex 渠道,但没有复用正常转发链路的
chat_completions_to_responses_policy。因此命中该策略的渠道和模型在实际请求中走 Responses API,渠道测试却仍可能走 Chat Completions 并误报失败。本变更让 endpoint 自动选择调用现有全局兼容策略:只有渠道和模型同时命中时才选择 Responses;显式 endpoint 仍具有最高优先级,Compact 与 Codex 的既有行为不变。测试覆盖命中、模型不匹配、渠道不匹配和显式 endpoint 覆盖场景。
🚀 变更类型 / Type of change
🔗 关联任务 / Related Issue
✅ 提交前检查项 / Checklist
📸 运行证明 / Proof of Work
以下命令已通过: