fix(routing): prioritize known models over discovery fallbacks

Prefer providers whose catalogs contain the mapped model before providers accepting unlisted models. Preserve account scope, route constraints, provider order within each tier, and unknown-model passthrough.

Add compiled mixed-catalog regressions and document candidate ordering. Refs #391.

Co-authored-by: Codex <noreply@openai.com>
This commit is contained in:
Zyy
2026-10-11 23:04:51 +08:00
co-authored by Codex
parent 45b473c7e2
commit 97faca0c45
3 changed files with 221 additions and 5 deletions
+4
View File
@@ -608,6 +608,10 @@ Client Key 与账号分组形成授权范围:
- 已绑定分组为空或全部禁用时得到空池,绝不回退为全部账号
- 分组可以包含多个 Provider,账号也可以属于多个分组
Core 在账号授权、模型政策与请求路由约束内,优先选择目录明确包含映射后模型且能力匹配的 Provider,
再保留发现型或暂不可读目录的未知模型候选;两类候选各自保持 Provider 标识顺序。
目录缺项不阻止 OpenAI 模型透传,重试和跨 Provider fallback 仍受原有发送与重放安全边界约束
账号选择综合启停状态、credential/quota 事实、Redis cooldown、并发上限、权重、请求间隔和会话亲和。
默认账号并发上限为 `0` 时表示无限;账号独立正数上限仍优先,未设置则继承默认值。
无限并发只跳过并发上限判断,保留在途租约计数、请求间隔及其他准入约束;含无限账号的容量不投影有限占用比例。