fix(gateway): 修复正则模型映射未生效到出站请求

修复 key allowed_models 通过 global_model_mappings 正则命中时,
候选选择仍使用 provider model mapping 作为出站模型的问题。

正则命中后将 allowed model 写入 selected_provider_model_name,
确保最终 execution runtime 请求体中的 model 使用映射后的模型。

补充三层回归测试:
- scheduler-core 正则映射解析
- gateway candidate/data 候选选择输出
- gateway ai_execute 出站请求 model 捕获
This commit is contained in:
AAEE86
2026-05-11 15:58:13 +08:00
parent 9057537ab8
commit 67ca47afd4
5 changed files with 285 additions and 7 deletions

View File

@@ -82,7 +82,7 @@ fn resolves_mapping_matched_model_from_global_regex_mapping() {
let resolved = resolve_provider_model_name(&row, "gpt-4.1", "openai:chat")
.expect("candidate should resolve");
assert_eq!(resolved.0, "gpt-4.1-canary");
assert_eq!(resolved.0, "gpt-4.1-variant");
assert_eq!(resolved.1, Some("gpt-4.1-variant".to_string()));
}