Skip to content

fix: 账号跨供应商路由切换失败 - #582

Merged
caigee-cmd merged 9 commits into
caigee-cmd:mainfrom
guyu233:fix/account-routing-failover
Nov 23, 2026
Merged

caigee-cmd merged 9 commits into
caigee-cmd:mainfrom
guyu233:fix/account-routing-failover

Conversation

@guyu233

@guyu233 guyu233 commented Nov 23, 2026

Copy link
Copy Markdown
Contributor

本 PR

修复账号路由切换失败的根因:

  • 跨供应商裸模型路由不再被第一次选中的 lastRegion 永久锁在一个 region;失败后可以跨 provider/region failover。
  • Qoder global/CN 的 provider-scoped 区域隔离保持不变,不会因本修复跨区。
  • 首次选号后不再按 pinned region 重算 attempts,避免该 region 只有 1 个账号时后续额度错误一次 failover 都没有。
  • priority 聚合按每个 priority tier 独立重试预算,第一供应商的 sibling accounts 不会耗尽全局预算。
  • legacy worker 路径在构造 payload 前应用账号模型别名/provider-native spelling,修复只走 in-process 路径生效的问题。
  • least-quota-first / most-quota-first 平局时按 lastPicked 游标轮换,不再固定最小账号 ID。

依赖

堆叠在聚合基线 #581 之上;请先合并 #581。

上线门槛

必须所有 required checks 通过后才能合并和上线;任何检查失败都不得上线。

需要全部通过:go、windows-host、worker、frontend、container、secrets。

本地验证

  • go build ./... 通过
  • 跨供应商 failover、Qoder 区域隔离、priority tier、worker alias、quota tie 定向测试通过

Rebuilt on current main. Migration is 031 (030 is reserved by the pending key aggregation PR). Display reasoning levels stay catalog-driven instead of merging the full gateway set, and local-only audit/vite changes are dropped. Changelog now notes probe quota cost and the priority-order default.
Add account_id to aggregation members end to end: schema migration, store, console API, model pool editor, and matching. Legacy members without account_id keep provider-wide pool behavior.
Expose least-quota-first and most-quota-first for model pools and global routing, with normalized strategy loading and candidate counting aligned to the selected strategy.
@guyu233
guyu233 force-pushed the fix/account-routing-failover branch from d1a1c93 to 4760801 Compare November 23, 2026 10:37
@guyu233
guyu233 force-pushed the fix/account-routing-failover branch from 4760801 to 8eb3feb Compare November 23, 2026 10:46
…ation

Release the implicit region latch only on cross-provider routes, preserve the retry budget after the first pick, give each priority tier its own budget, and apply account aliases in the worker path. Provider-scoped Qoder routes keep their region isolation.
@guyu233
guyu233 force-pushed the fix/account-routing-failover branch from 8eb3feb to b38b48e Compare November 23, 2026 10:53
@caigee-cmd
caigee-cmd merged commit b10ce19 into caigee-cmd:main Nov 23, 2026
6 checks passed
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.

2 participants