feat: scope model mappings by endpoint

This commit is contained in:
fawney19
2026-05-07 00:48:15 +08:00
parent 4e9f063385
commit 012f8bcdf7
58 changed files with 731 additions and 101 deletions
@@ -85,6 +85,7 @@ async fn gateway_skips_unsupported_local_openai_chat_sync_candidate_before_tryin
name: "gpt-5-upstream".to_string(),
priority: 1,
api_formats: Some(vec!["openai:chat".to_string()]),
endpoint_ids: None,
}]),
model_supports_streaming: Some(true),
model_is_active: true,
@@ -289,6 +290,7 @@ async fn gateway_skips_unsupported_local_openai_chat_sync_candidate_before_tryin
name: "gpt-5-upstream-backup".to_string(),
priority: 1,
api_formats: Some(vec!["openai:chat".to_string()]),
endpoint_ids: None,
}]);
let candidate_selection_repository =
Arc::new(InMemoryMinimalCandidateSelectionReadRepository::seed(vec![
@@ -485,6 +487,7 @@ async fn gateway_surfaces_local_execution_runtime_miss_reason_when_all_openai_ch
name: "gpt-5-upstream".to_string(),
priority: 1,
api_formats: Some(vec!["openai:chat".to_string()]),
endpoint_ids: None,
}]),
model_supports_streaming: Some(true),
model_is_active: true,
@@ -758,6 +761,7 @@ async fn gateway_retries_next_local_openai_chat_sync_candidate_after_auth_failur
name: mapped_model.to_string(),
priority: 1,
api_formats: Some(vec!["openai:chat".to_string()]),
endpoint_ids: None,
}]),
model_supports_streaming: Some(true),
model_is_active: true,
@@ -84,6 +84,7 @@ async fn gateway_executes_openai_chat_sync_via_local_decision_gate_without_execu
name: "gpt-5-upstream".to_string(),
priority: 1,
api_formats: Some(vec!["openai:chat".to_string()]),
endpoint_ids: None,
}]),
model_supports_streaming: Some(true),
model_is_active: true,
@@ -276,6 +277,7 @@ async fn gateway_executes_openai_chat_sync_via_local_decision_gate_without_execu
name: "gpt-5-upstream-backup".to_string(),
priority: 1,
api_formats: Some(vec!["openai:chat".to_string()]),
endpoint_ids: None,
}]);
let candidate_selection_repository =
Arc::new(InMemoryMinimalCandidateSelectionReadRepository::seed(vec![
@@ -470,6 +472,7 @@ async fn gateway_executes_openai_chat_sync_via_local_cross_format_gemini_candida
name: "gemini-2.5-pro-upstream".to_string(),
priority: 1,
api_formats: Some(vec!["gemini:generate_content".to_string()]),
endpoint_ids: None,
}]),
model_supports_streaming: Some(true),
model_is_active: true,
@@ -490,6 +493,7 @@ async fn gateway_executes_openai_chat_sync_via_local_cross_format_gemini_candida
name: "gemini-2.5-flash-upstream".to_string(),
priority: 2,
api_formats: Some(vec!["gemini:generate_content".to_string()]),
endpoint_ids: None,
}]);
row
}
@@ -1032,6 +1036,7 @@ async fn gateway_returns_openai_chat_error_for_local_cross_format_claude_cli_syn
name: "claude-code-upstream".to_string(),
priority: 1,
api_formats: Some(vec!["claude:messages".to_string()]),
endpoint_ids: None,
}]),
model_supports_streaming: Some(true),
model_is_active: true,
@@ -1429,6 +1434,7 @@ async fn gateway_returns_openai_chat_error_for_local_cross_format_gemini_cli_syn
name: "gemini-cli-upstream".to_string(),
priority: 1,
api_formats: Some(vec!["gemini:generate_content".to_string()]),
endpoint_ids: None,
}]),
model_supports_streaming: Some(true),
model_is_active: true,
@@ -1826,6 +1832,7 @@ async fn gateway_returns_openai_chat_error_for_local_cross_format_claude_sync_fa
name: "claude-sonnet-4-5-upstream".to_string(),
priority: 1,
api_formats: Some(vec!["claude:messages".to_string()]),
endpoint_ids: None,
}]),
model_supports_streaming: Some(true),
model_is_active: true,
@@ -2229,6 +2236,7 @@ async fn gateway_returns_openai_chat_error_for_local_cross_format_gemini_sync_fa
name: "gemini-2.5-pro-upstream".to_string(),
priority: 1,
api_formats: Some(vec!["gemini:generate_content".to_string()]),
endpoint_ids: None,
}]),
model_supports_streaming: Some(true),
model_is_active: true,
@@ -2672,6 +2680,7 @@ async fn gateway_executes_openai_chat_sync_with_custom_path_via_local_decision_g
name: "gpt-5-upstream".to_string(),
priority: 1,
api_formats: Some(vec!["openai:chat".to_string()]),
endpoint_ids: None,
}]),
model_supports_streaming: Some(true),
model_is_active: true,
@@ -128,6 +128,7 @@ async fn gateway_executes_claude_code_cli_sync_via_local_decision_gate_with_loca
name: "claude-code-upstream".to_string(),
priority: 1,
api_formats: Some(vec!["claude:messages".to_string()]),
endpoint_ids: None,
}]),
model_supports_streaming: Some(true),
model_is_active: true,
@@ -169,6 +169,7 @@ async fn gateway_executes_kiro_claude_cli_sync_via_local_provider_catalog_candid
name: "claude-sonnet-4-upstream".to_string(),
priority: 1,
api_formats: Some(vec!["claude:messages".to_string()]),
endpoint_ids: None,
}]),
model_supports_streaming: Some(true),
model_is_active: true,
@@ -735,6 +736,7 @@ async fn gateway_executes_kiro_claude_cli_sync_via_local_provider_catalog_candid
name: "claude-sonnet-4-upstream".to_string(),
priority: 1,
api_formats: Some(vec!["claude:messages".to_string()]),
endpoint_ids: None,
}]),
model_supports_streaming: Some(true),
model_is_active: true,
@@ -123,6 +123,7 @@ async fn gateway_executes_claude_chat_sync_via_local_decision_gate_with_local_sy
name: "claude-sonnet-4-5-upstream".to_string(),
priority: 1,
api_formats: Some(vec!["claude:messages".to_string()]),
endpoint_ids: None,
}]),
model_supports_streaming: Some(true),
model_is_active: true,
@@ -692,6 +693,7 @@ async fn gateway_returns_claude_chat_error_for_local_sync_failure_impl() {
name: "claude-sonnet-4-5-upstream".to_string(),
priority: 1,
api_formats: Some(vec!["claude:messages".to_string()]),
endpoint_ids: None,
}]),
model_supports_streaming: Some(true),
model_is_active: true,
@@ -123,6 +123,7 @@ async fn gateway_executes_claude_cli_sync_via_local_decision_gate_with_local_syn
name: "claude-code-upstream".to_string(),
priority: 1,
api_formats: Some(vec!["claude:messages".to_string()]),
endpoint_ids: None,
}]),
model_supports_streaming: Some(true),
model_is_active: true,
@@ -568,6 +569,7 @@ async fn gateway_returns_claude_cli_error_for_local_sync_failure_impl() {
name: "claude-code-upstream".to_string(),
priority: 1,
api_formats: Some(vec!["claude:messages".to_string()]),
endpoint_ids: None,
}]),
model_supports_streaming: Some(true),
model_is_active: true,
@@ -850,6 +852,7 @@ async fn gateway_marks_claude_cli_cross_format_runtime_miss_when_format_conversi
name: "gpt-5.4".to_string(),
priority: 1,
api_formats: Some(vec!["openai:responses".to_string()]),
endpoint_ids: None,
}]),
model_supports_streaming: Some(true),
model_is_active: true,
@@ -110,6 +110,7 @@ async fn gateway_executes_openai_responses_sync_via_local_decision_gate_with_loc
name: "gpt-5-upstream".to_string(),
priority: 1,
api_formats: Some(vec!["openai:responses".to_string()]),
endpoint_ids: None,
}]),
model_supports_streaming: Some(true),
model_is_active: true,
@@ -611,6 +612,7 @@ async fn gateway_waits_for_api_key_concurrency_slot_then_executes_openai_respons
name: "gpt-5-upstream".to_string(),
priority: 1,
api_formats: Some(vec!["openai:responses".to_string()]),
endpoint_ids: None,
}]),
model_supports_streaming: Some(true),
model_is_active: true,
@@ -993,6 +995,7 @@ async fn gateway_returns_concurrency_limited_after_wait_budget_expires_for_opena
name: "gpt-5-upstream".to_string(),
priority: 1,
api_formats: Some(vec!["openai:responses".to_string()]),
endpoint_ids: None,
}]),
model_supports_streaming: Some(true),
model_is_active: true,
@@ -1341,6 +1344,7 @@ async fn gateway_returns_openai_responses_error_for_local_sync_failure() {
name: "gpt-5-upstream".to_string(),
priority: 1,
api_formats: Some(vec!["openai:responses".to_string()]),
endpoint_ids: None,
}]),
model_supports_streaming: Some(true),
model_is_active: true,
@@ -1643,6 +1647,7 @@ async fn gateway_returns_openai_responses_error_for_local_cross_format_gemini_sy
name: "gemini-cli-upstream".to_string(),
priority: 1,
api_formats: Some(vec!["gemini:generate_content".to_string()]),
endpoint_ids: None,
}]),
model_supports_streaming: Some(true),
model_is_active: true,
@@ -2019,6 +2024,7 @@ async fn gateway_returns_openai_responses_error_for_local_cross_format_claude_sy
name: "claude-code-upstream".to_string(),
priority: 1,
api_formats: Some(vec!["claude:messages".to_string()]),
endpoint_ids: None,
}]),
model_supports_streaming: Some(true),
model_is_active: true,
@@ -2395,6 +2401,7 @@ async fn gateway_returns_openai_responses_error_for_local_cross_format_claude_ch
name: "claude-sonnet-4-5-upstream".to_string(),
priority: 1,
api_formats: Some(vec!["claude:messages".to_string()]),
endpoint_ids: None,
}]),
model_supports_streaming: Some(true),
model_is_active: true,
@@ -2774,6 +2781,7 @@ async fn gateway_returns_openai_responses_error_for_local_cross_format_gemini_ch
name: "gemini-2.5-pro-upstream".to_string(),
priority: 1,
api_formats: Some(vec!["gemini:generate_content".to_string()]),
endpoint_ids: None,
}]),
model_supports_streaming: Some(true),
model_is_active: true,
@@ -3160,6 +3168,7 @@ async fn gateway_executes_codex_cli_sync_via_local_decision_gate_after_oauth_ref
name: "gpt-5.4".to_string(),
priority: 1,
api_formats: Some(vec!["openai:responses".to_string()]),
endpoint_ids: None,
}]),
model_supports_streaming: Some(true),
model_is_active: true,
@@ -122,6 +122,7 @@ async fn gateway_executes_gemini_cli_sync_via_local_decision_gate_with_local_syn
name: "gemini-cli-upstream".to_string(),
priority: 1,
api_formats: Some(vec!["gemini:generate_content".to_string()]),
endpoint_ids: None,
}]),
model_supports_streaming: Some(true),
model_is_active: true,
@@ -553,6 +554,7 @@ async fn gateway_returns_gemini_cli_error_for_local_sync_failure_impl() {
name: "gemini-cli-upstream".to_string(),
priority: 1,
api_formats: Some(vec!["gemini:generate_content".to_string()]),
endpoint_ids: None,
}]),
model_supports_streaming: Some(true),
model_is_active: true,
@@ -852,6 +854,7 @@ async fn gateway_executes_gemini_cli_sync_via_local_decision_gate_after_oauth_re
name: "gemini-cli-upstream".to_string(),
priority: 1,
api_formats: Some(vec!["gemini:generate_content".to_string()]),
endpoint_ids: None,
}]),
model_supports_streaming: Some(true),
model_is_active: true,
@@ -1362,6 +1365,7 @@ async fn gateway_executes_vertex_ai_gemini_cli_sync_via_local_decision_gate_with
name: "gemini-cli-upstream".to_string(),
priority: 1,
api_formats: Some(vec!["gemini:generate_content".to_string()]),
endpoint_ids: None,
}]),
model_supports_streaming: Some(true),
model_is_active: true,
@@ -1807,6 +1811,7 @@ async fn gateway_executes_antigravity_gemini_cli_sync_via_local_decision_gate_af
name: "claude-sonnet-4-5".to_string(),
priority: 1,
api_formats: Some(vec!["gemini:generate_content".to_string()]),
endpoint_ids: None,
}]),
model_supports_streaming: Some(true),
model_is_active: true,
@@ -122,6 +122,7 @@ async fn gateway_executes_gemini_chat_sync_via_local_decision_gate_with_local_sy
name: "gemini-2.5-pro-upstream".to_string(),
priority: 1,
api_formats: Some(vec!["gemini:generate_content".to_string()]),
endpoint_ids: None,
}]),
model_supports_streaming: Some(true),
model_is_active: true,
@@ -543,6 +544,7 @@ async fn gateway_returns_gemini_chat_error_for_local_sync_failure_impl() {
name: "gemini-2.5-pro-upstream".to_string(),
priority: 1,
api_formats: Some(vec!["gemini:generate_content".to_string()]),
endpoint_ids: None,
}]),
model_supports_streaming: Some(true),
model_is_active: true,
@@ -110,6 +110,7 @@ async fn gateway_executes_codex_image_sync_via_local_decision_gate_after_oauth_r
name: "gpt-image-2".to_string(),
priority: 1,
api_formats: Some(vec!["openai:image".to_string()]),
endpoint_ids: None,
}]),
model_supports_streaming: Some(true),
model_is_active: true,
@@ -604,6 +605,7 @@ async fn gateway_plans_chatgpt_web_image_sync_with_internal_web_executor_url() {
name: "gpt-image-2".to_string(),
priority: 1,
api_formats: Some(vec!["openai:image".to_string()]),
endpoint_ids: None,
}]),
model_supports_streaming: Some(true),
model_is_active: true,