refactor: 简化模型权限检查,移除 resolved_model_name 参数

- 从 check_model_allowed 和 check_model_allowed_with_mappings 移除 resolved_model_name 参数
- 优化匹配逻辑:先精确匹配 model_name,再检查 candidate_models 交集,最后进行映射匹配
- 更新 CacheAwareScheduler 中的相关调用,传入 provider_model_names 作为 candidate_models
- 同步更新测试用例
This commit is contained in:
fawney19
2026-01-23 00:57:47 +08:00
parent 7ef0488419
commit 08a3148ab3
6 changed files with 40 additions and 66 deletions

View File

@@ -300,7 +300,6 @@ class AdminGetModelRoutingPreviewAdapter(AdminApiAdapter):
is_allowed, _ = check_model_allowed_with_mappings(
model_name=global_model.name,
allowed_models=allowed_models_list,
resolved_model_name=global_model.name,
model_mappings=global_model_mappings,
)
return is_allowed