Skip to content

fix(channel-test): honor Responses compatibility policy - #6290

Open
linjzy wants to merge 2 commits into
QuantumNous:mainfrom
linjzy:fix/channel-test-responses-policy
Open

fix(channel-test): honor Responses compatibility policy#6290
linjzy wants to merge 2 commits into
QuantumNous:mainfrom
linjzy:fix/channel-test-responses-policy

Conversation

@linjzy

@linjzy linjzy commented Jul 18, 2026

Copy link
Copy Markdown

⚠️ 提交说明 / PR Notice

Important

  • 请提供人工撰写的简洁摘要,避免直接粘贴未经整理的 AI 输出。

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

  • 🐛 Bug 修复 (Bug fix) - 请关联对应 Issue,避免将设计取舍、理解偏差或预期不一致直接归类为 bug
  • ✨ 新功能 (New feature) - 重大特性建议先通过 Issue 沟通
  • ⚡ 性能优化 / 重构 (Refactor)
  • 📝 文档更新 (Documentation)

🔗 关联任务 / Related Issue

✅ 提交前检查项 / Checklist

  • 人工确认: 我已亲自整理并撰写此描述,没有直接粘贴未经处理的 AI 输出。
  • 非重复提交: 我已搜索现有的 IssuesPRs,确认不是重复提交。
  • Bug fix 说明: 已关联 fix: make channel tests honor the Responses compatibility policy #6293;该问题会让渠道测试与正常转发策略不一致并产生误报。
  • 变更理解: 我已理解这些更改的工作原理及可能影响。
  • 范围聚焦: 本 PR 未包含任何与当前任务无关的代码改动。
  • 本地验证: 已在本地运行并通过测试或手动验证,维护者可以据此复核结果。
  • 安全合规: 代码中无敏感凭据,且符合项目代码规范。

📸 运行证明 / Proof of Work

以下命令已通过:

go test ./controller

@coderabbitai

coderabbitai Bot commented Jul 18, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

Walkthrough

Channel 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.

Changes

Channel test endpoint selection

Layer / File(s) Summary
Responses policy normalization and tests
controller/channel-test.go, controller/channel_test_endpoint_test.go
normalizeChannelTestEndpoint selects EndpointTypeOpenAIResponse when the channel and model match the global compatibility policy. Tests cover matching and non-matching inputs and preserve explicit endpoints.

Estimated code review effort: 2 (Simple) | ~10 minutes

Poem

I’m a rabbit with endpoints neat,
Responses now guide each test’s feet.
Matching models hop the right way,
Explicit paths stay where they lay.
Green tests nibble bugs away.

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Linked Issues check ✅ Passed The PR matches #6293 by honoring the Responses compatibility policy while preserving explicit endpoint and existing priority rules.
Out of Scope Changes check ✅ Passed The changes are tightly scoped to endpoint normalization and its tests, with no clear unrelated additions.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly matches the main change: channel-test now honors the Responses compatibility policy.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

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.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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

📥 Commits

Reviewing files that changed from the base of the PR and between 5a6c53d and 953704e.

📒 Files selected for processing (2)
  • controller/channel-test.go
  • controller/channel_test_endpoint_test.go

Comment thread controller/channel_test_endpoint_test.go Outdated
@linjzy
linjzy marked this pull request as ready for review July 18, 2026 13:54
@Calcium-Ion
Calcium-Ion force-pushed the main branch 2 times, most recently from 51fdfc5 to 2b6f1df Compare August 30, 2026 15:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

fix: make channel tests honor the Responses compatibility policy

1 participant