Repository navigation
Conversation
Use the mapped upstream model when inferring automatic channel test endpoints and add regression coverage for issue QuantumNous#4487. Refs QuantumNous#4487 Co-Authored-By: Claude Opus 4.7 <[email protected]>
WalkthroughRefactors channel test's automatic endpoint detection to resolve model mappings before determining request paths, ensuring the endpoint selection uses the final mapped model rather than the original model name. Changes
Estimated code review effort🎯 2 (Simple) | ⏱️ ~12 minutes Possibly related PRs
Poem
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ 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.
🧹 Nitpick comments (1)
controller/channel_test_internal_test.go (1)
75-95: LGTM — focused regression coverage for the reported bug.
TestResolveAutomaticChannelTestModelAppliesModelMappingexercises the exact scenario from#4487(gpt-5.3-codex→deepseek-v4-proresolves to/v1/chat/completions), andTestNormalizeChannelTestEndpointKeepsCodexChannelOnResponsespins the unchanged Codex default.Optional follow-ups (not blocking):
- Add a chain mapping case (
a → b → c) to lock in the chain-traversal behavior ofresolveAutomaticChannelTestModel.- Add a cycle case (
a → b → a) to document that cycles short-circuit safely without panicking.🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@controller/channel_test_internal_test.go` around lines 75 - 95, Add two additional unit tests to cover mapping chains and cycles for resolveAutomaticChannelTestModel: create a test that verifies a chain mapping (e.g., "a" -> "b", "b" -> "c") resolves "a" to "c" and another test that verifies a cycle (e.g., "a" -> "b", "b" -> "a") short-circuits safely without panic and returns a stable value; locate and update tests near TestResolveAutomaticChannelTestModelAppliesModelMapping and use the same helpers (resolveAutomaticChannelTestModel and detectAutomaticChannelTestRequestPath) to assert resolvedModel and requestPath behavior.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Nitpick comments:
In `@controller/channel_test_internal_test.go`:
- Around line 75-95: Add two additional unit tests to cover mapping chains and
cycles for resolveAutomaticChannelTestModel: create a test that verifies a chain
mapping (e.g., "a" -> "b", "b" -> "c") resolves "a" to "c" and another test that
verifies a cycle (e.g., "a" -> "b", "b" -> "a") short-circuits safely without
panic and returns a stable value; locate and update tests near
TestResolveAutomaticChannelTestModelAppliesModelMapping and use the same helpers
(resolveAutomaticChannelTestModel and detectAutomaticChannelTestRequestPath) to
assert resolvedModel and requestPath behavior.
ℹ️ Review info
⚙️ Run configuration
Configuration used: Organization UI
Review profile: CHILL
Plan: Pro
Run ID: db9afc8e-e336-4a08-af68-b1c7cbe37a98
📒 Files selected for processing (2)
controller/channel-test.gocontroller/channel_test_internal_test.go
51fdfc5 to
2b6f1df
Compare
docs: finalize community improvement batches and validation Document eight implemented capabilities, review fixes, exact commits, CI evidence and upstream correspondence. Preserve identity, Redis and evaluation boundaries, and provide the model governance lifecycle/API guide. All functional PRs were reviewed and merged after successful regression tests and Verify CI. The running checkout and services were not changed. Refs: QuantumNous/new-api issue #1730 QuantumNous/new-api#1730 Refs: QuantumNous/new-api issue #2841 QuantumNous/new-api#2841 Refs: QuantumNous/new-api issue #3240 QuantumNous/new-api#3240 Refs: QuantumNous/new-api PR #3345 QuantumNous/new-api#3345 Refs: QuantumNous/new-api issue #4328 QuantumNous/new-api#4328 Refs: QuantumNous/new-api PR #4329 QuantumNous/new-api#4329 Refs: QuantumNous/new-api PR #4492 QuantumNous/new-api#4492 Refs: QuantumNous/new-api PR #5431 QuantumNous/new-api#5431 Refs: QuantumNous/new-api PR #5791 QuantumNous/new-api#5791 Refs: QuantumNous/new-api PR #6264 QuantumNous/new-api#6264 Refs: QuantumNous/new-api PR #6583 QuantumNous/new-api#6583 Refs: QuantumNous/new-api PR #6620 QuantumNous/new-api#6620 Refs: QuantumNous/new-api PR #6673 QuantumNous/new-api#6673 Refs: QuantumNous/new-api issue #6972 QuantumNous/new-api#6972 Refs: QuantumNous/new-api PR #7028 QuantumNous/new-api#7028 Refs: QuantumNous/new-api issue #7951 QuantumNous/new-api#7951 Refs: QuantumNous/new-api issue #7952 QuantumNous/new-api#7952 Refs: QuantumNous/new-api PR #7953 QuantumNous/new-api#7953 Refs: QuantumNous/new-api PR #7955 QuantumNous/new-api#7955 Refs: QuantumNous/new-api issue #8034 QuantumNous/new-api#8034 Refs: QuantumNous/new-api PR #8076 QuantumNous/new-api#8076 Refs: QuantumNous/new-api issue #8123 QuantumNous/new-api#8123 Refs: QuantumNous/new-api PR #8124 QuantumNous/new-api#8124 Refs: QuantumNous/new-api issue #8232 QuantumNous/new-api#8232 Refs: QuantumNous/new-api PR #8233 QuantumNous/new-api#8233 Refs: QuantumNous/new-api issue #8295 QuantumNous/new-api#8295 Refs: QuantumNous/new-api PR #8296 QuantumNous/new-api#8296 Refs: QuantumNous/new-api PR #8350 QuantumNous/new-api#8350 Refs: QuantumNous/new-api PR #8357 QuantumNous/new-api#8357 Refs: QuantumNous/new-api PR #8363 QuantumNous/new-api#8363 Refs: #99 #99 Refs: #100 #100 Refs: #101 #101 Refs: #102 #102 Refs: #103 #103 Refs: #104 #104 Refs: #105 #105 Refs: #106 #106 Refs: #107 #107 Refs: #108 #108 Refs: #109 #109 Documentation Verify CI passed: https://github.com/soulteary/yunqi/actions/runs/45003986698
Important
📝 变更描述 / Description
本次修改修复了 channel test 在存在
model_mapping时的自动端点推断问题。问题在于:当未显式传入
endpoint_type时,testChannel会先根据原始测试模型名推断请求路径,再应用 channel 的model_mapping。例如测试模型为
gpt-5.3-codex,并映射到deepseek-v4-pro时,原逻辑会先因为模型名包含codex而推断出/v1/responses,随后才将模型映射为deepseek-v4-pro。这样最终会把 DeepSeek 渠道请求错误地发送到 responses 路径,导致 404。本 PR 的修改方式是:
endpoint_type时,先解析model_mapping得到最终上游模型endpoint_type时的原有行为不变同时补充了回归测试,覆盖:
gpt-5.3-codex -> deepseek-v4-pro时应走 chat completions 路径🚀 变更类型 / Type of change
🔗 关联任务 / Related Issue
✅ 提交前检查项 / Checklist
Bug fix,我已提交或关联对应 Issue,且不会将设计取舍、预期不一致或理解偏差直接归类为 bug。📸 运行证明 / Proof of Work
Issue 中的复现请求示例:
📸 运行证明 / Proof of Work
(请在此粘贴截图、关键日志或测试报告,以证明变更生效)
Codex官方渠道正常:

Summary by CodeRabbit
Refactor
Tests