Skip to content

fix: fall back to lower priority channels - #6235

Closed
SameTrouble wants to merge 1 commit into
QuantumNous:mainfrom
SameTrouble:codex/fix-channel-priority-fallback
Closed

fix: fall back to lower priority channels#6235
SameTrouble wants to merge 1 commit into
QuantumNous:mainfrom
SameTrouble:codex/fix-channel-priority-fallback

Conversation

@SameTrouble

@SameTrouble SameTrouble commented Jul 16, 2026

Copy link
Copy Markdown

⚠️ 提交说明 / PR Notice

Important

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

📝 变更描述 / Description

(简述:做了什么?为什么这样改能生效?请基于你对代码逻辑的理解来写,避免粘贴未经整理的内容)

🚀 变更类型 / Type of change

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

🔗 关联任务 / Related Issue

  • Closes # (如有)

✅ 提交前检查项 / Checklist

  • 人工确认: 我已亲自整理并撰写此描述,没有直接粘贴未经处理的 AI 输出。
  • 非重复提交: 我已搜索现有的 IssuesPRs,确认不是重复提交。
  • Bug fix 说明: 若此 PR 标记为 Bug fix,我已提交或关联对应 Issue,且不会将设计取舍、预期不一致或理解偏差直接归类为 bug。
  • 变更理解: 我已理解这些更改的工作原理及可能影响。
  • 范围聚焦: 本 PR 未包含任何与当前任务无关的代码改动。
  • 本地验证: 已在本地运行并通过测试或手动验证,维护者可以据此复核结果。
  • 安全合规: 代码中无敏感凭据,且符合项目代码规范。

📸 运行证明 / Proof of Work

(请在此粘贴截图、关键日志或测试报告,以证明变更生效)

Summary by CodeRabbit

  • Enhancements

    • Improved channel selection to consistently honor ability-level priorities.
    • Retry attempts can now move selection to lower-priority eligible channels.
    • Channel selection better respects request paths and models before choosing a channel.
    • Disabled abilities are excluded from cached channel selection.
    • Selection now falls back to the next eligible channel when a higher-priority option cannot handle the request.
  • Bug Fixes

    • Corrected priority handling after channel cache updates.
    • Improved consistency between cached and non-cached channel selection.

@SameTrouble
SameTrouble deleted the codex/fix-channel-priority-fallback branch July 16, 2026 00:22
@coderabbitai

coderabbitai Bot commented Jul 16, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

Caution

Review failed

The pull request is closed.

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: ae621f94-476a-4022-895c-ba06e463849b

📥 Commits

Reviewing files that changed from the base of the PR and between a63364d and 4581663.

📒 Files selected for processing (3)
  • model/ability.go
  • model/channel_cache.go
  • model/channel_priority_test.go

Walkthrough

Channel selection now uses enabled ability priorities for retry ordering in database and cached paths. Request-path filtering occurs before priority selection, and tests cover retries, disabled abilities, ability overrides, cache updates, and route eligibility.

Changes

Priority-aware channel selection

Layer / File(s) Summary
Database priority selection
model/ability.go, model/channel_priority_test.go
GetChannel filters eligible abilities before selecting descending priorities and weighted channel IDs; tests cover retries and route-ineligible higher-priority channels.
Cached priority selection
model/channel_cache.go, model/channel_priority_test.go
The cache stores ability-derived priorities and uses them for retry selection, including disabled abilities, ability overrides, and refreshed channel metadata.

Estimated code review effort: 3 (Moderate) | ~25 minutes

Suggested reviewers: calcium-ion

Poem

A rabbit sorts the channels bright,
By carrot-priority, left to right.
Retry hops to the next-best way,
While route guards choose where paths may stay.
Cache and database dance tonight!

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

Warning

⚠️ This pull request shows signs of AI-generated slop (description_diff_mismatch, ai_padded_prose). It has been flagged by CodeRabbit slop detection and should be reviewed carefully.

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.

1 participant