Normalize canonical API formats

This commit is contained in:
fawney19
2026-04-29 10:20:41 +08:00
parent 02ad67fe33
commit 07a319259b
171 changed files with 2460 additions and 1962 deletions
@@ -48,7 +48,7 @@ async fn gateway_executes_claude_code_cli_sync_via_local_decision_gate_with_loca
true,
false,
Some(serde_json::json!(["claude", "claude_code"])),
Some(serde_json::json!(["claude:cli"])),
Some(serde_json::json!(["claude:messages"])),
Some(serde_json::json!(["claude-code"])),
api_key_id.to_string(),
Some("default".to_string()),
@@ -59,7 +59,7 @@ async fn gateway_executes_claude_code_cli_sync_via_local_decision_gate_with_loca
Some(5),
Some(4_102_444_800),
Some(serde_json::json!(["claude", "claude_code"])),
Some(serde_json::json!(["claude:cli"])),
Some(serde_json::json!(["claude:messages"])),
Some(serde_json::json!(["claude-code"])),
)
.expect("auth snapshot should build")
@@ -73,7 +73,7 @@ async fn gateway_executes_claude_code_cli_sync_via_local_decision_gate_with_loca
provider_priority: 10,
provider_is_active: true,
endpoint_id: "endpoint-claude-code-cli-local-1".to_string(),
endpoint_api_format: "claude:cli".to_string(),
endpoint_api_format: "claude:messages".to_string(),
endpoint_api_family: Some("claude".to_string()),
endpoint_kind: Some("cli".to_string()),
endpoint_is_active: true,
@@ -81,11 +81,11 @@ async fn gateway_executes_claude_code_cli_sync_via_local_decision_gate_with_loca
key_name: "prod".to_string(),
key_auth_type: "oauth".to_string(),
key_is_active: true,
key_api_formats: Some(vec!["claude:cli".to_string()]),
key_api_formats: Some(vec!["claude:messages".to_string()]),
key_allowed_models: None,
key_capabilities: None,
key_internal_priority: 5,
key_global_priority_by_format: Some(serde_json::json!({"claude:cli": 1})),
key_global_priority_by_format: Some(serde_json::json!({"claude:messages": 1})),
model_id: "model-claude-code-cli-local-1".to_string(),
global_model_id: "global-model-claude-code-cli-local-1".to_string(),
global_model_name: "claude-code".to_string(),
@@ -95,7 +95,7 @@ async fn gateway_executes_claude_code_cli_sync_via_local_decision_gate_with_loca
model_provider_model_mappings: Some(vec![StoredProviderModelMapping {
name: "claude-code-upstream".to_string(),
priority: 1,
api_formats: Some(vec!["claude:cli".to_string()]),
api_formats: Some(vec!["claude:messages".to_string()]),
}]),
model_supports_streaming: Some(true),
model_is_active: true,
@@ -132,7 +132,7 @@ async fn gateway_executes_claude_code_cli_sync_via_local_decision_gate_with_loca
StoredProviderCatalogEndpoint::new(
"endpoint-claude-code-cli-local-1".to_string(),
"provider-claude-code-cli-local-1".to_string(),
"claude:cli".to_string(),
"claude:messages".to_string(),
Some("claude".to_string()),
Some("cli".to_string()),
true,
@@ -167,7 +167,7 @@ async fn gateway_executes_claude_code_cli_sync_via_local_decision_gate_with_loca
)
.expect("key should build")
.with_transport_fields(
Some(serde_json::json!(["claude:cli"])),
Some(serde_json::json!(["claude:messages"])),
encrypt_python_fernet_plaintext(
DEVELOPMENT_ENCRYPTION_KEY,
"sk-upstream-claude-code-oauth",
@@ -175,7 +175,7 @@ async fn gateway_executes_claude_code_cli_sync_via_local_decision_gate_with_loca
.expect("api key should encrypt"),
None,
None,
Some(serde_json::json!({"claude:cli": 1})),
Some(serde_json::json!({"claude:messages": 1})),
None,
None,
Some(
@@ -121,7 +121,7 @@ async fn gateway_executes_kiro_claude_cli_sync_via_local_provider_catalog_candid
true,
false,
Some(serde_json::json!(["claude", "kiro"])),
Some(serde_json::json!(["claude:cli"])),
Some(serde_json::json!(["claude:messages"])),
Some(serde_json::json!(["claude-sonnet-4"])),
api_key_id.to_string(),
Some("default".to_string()),
@@ -132,7 +132,7 @@ async fn gateway_executes_kiro_claude_cli_sync_via_local_provider_catalog_candid
Some(5),
Some(4_102_444_800),
Some(serde_json::json!(["claude", "kiro"])),
Some(serde_json::json!(["claude:cli"])),
Some(serde_json::json!(["claude:messages"])),
Some(serde_json::json!(["claude-sonnet-4"])),
)
.expect("auth snapshot should build")
@@ -146,7 +146,7 @@ async fn gateway_executes_kiro_claude_cli_sync_via_local_provider_catalog_candid
provider_priority: 10,
provider_is_active: true,
endpoint_id: "endpoint-kiro-cli-local-sync-1".to_string(),
endpoint_api_format: "claude:cli".to_string(),
endpoint_api_format: "claude:messages".to_string(),
endpoint_api_family: Some("claude".to_string()),
endpoint_kind: Some("cli".to_string()),
endpoint_is_active: true,
@@ -154,11 +154,11 @@ async fn gateway_executes_kiro_claude_cli_sync_via_local_provider_catalog_candid
key_name: "prod".to_string(),
key_auth_type: "bearer".to_string(),
key_is_active: true,
key_api_formats: Some(vec!["claude:cli".to_string()]),
key_api_formats: Some(vec!["claude:messages".to_string()]),
key_allowed_models: None,
key_capabilities: None,
key_internal_priority: 5,
key_global_priority_by_format: Some(serde_json::json!({"claude:cli": 1})),
key_global_priority_by_format: Some(serde_json::json!({"claude:messages": 1})),
model_id: "model-kiro-cli-local-sync-1".to_string(),
global_model_id: "global-model-kiro-cli-local-sync-1".to_string(),
global_model_name: "claude-sonnet-4".to_string(),
@@ -168,7 +168,7 @@ async fn gateway_executes_kiro_claude_cli_sync_via_local_provider_catalog_candid
model_provider_model_mappings: Some(vec![StoredProviderModelMapping {
name: "claude-sonnet-4-upstream".to_string(),
priority: 1,
api_formats: Some(vec!["claude:cli".to_string()]),
api_formats: Some(vec!["claude:messages".to_string()]),
}]),
model_supports_streaming: Some(true),
model_is_active: true,
@@ -201,7 +201,7 @@ async fn gateway_executes_kiro_claude_cli_sync_via_local_provider_catalog_candid
StoredProviderCatalogEndpoint::new(
"endpoint-kiro-cli-local-sync-1".to_string(),
"provider-kiro-cli-local-sync-1".to_string(),
"claude:cli".to_string(),
"claude:messages".to_string(),
Some("claude".to_string()),
Some("cli".to_string()),
true,
@@ -249,7 +249,7 @@ async fn gateway_executes_kiro_claude_cli_sync_via_local_provider_catalog_candid
)
.expect("key should build")
.with_transport_fields(
Some(serde_json::json!(["claude:cli"])),
Some(serde_json::json!(["claude:messages"])),
encrypt_python_fernet_plaintext(DEVELOPMENT_ENCRYPTION_KEY, "__placeholder__")
.expect("api key should encrypt"),
Some(
@@ -260,7 +260,7 @@ async fn gateway_executes_kiro_claude_cli_sync_via_local_provider_catalog_candid
.expect("auth config should encrypt"),
),
None,
Some(serde_json::json!({"claude:cli": 1})),
Some(serde_json::json!({"claude:messages": 1})),
None,
None,
Some(serde_json::json!({"enabled": true, "node_id":"proxy-node-kiro-cli-local-sync"})),
@@ -289,7 +289,7 @@ async fn gateway_executes_kiro_claude_cli_sync_via_local_provider_catalog_candid
"route_class": "ai_public",
"route_family": "claude",
"route_kind": "cli",
"auth_endpoint_signature": "claude:cli",
"auth_endpoint_signature": "claude:messages",
"execution_runtime_candidate": true,
"auth_context": {
"user_id": "user-kiro-cli-local-sync-123",
@@ -683,7 +683,7 @@ async fn gateway_executes_kiro_claude_cli_sync_via_local_provider_catalog_candid
true,
false,
Some(serde_json::json!(["claude", "kiro"])),
Some(serde_json::json!(["claude:cli"])),
Some(serde_json::json!(["claude:messages"])),
Some(serde_json::json!(["claude-sonnet-4"])),
api_key_id.to_string(),
Some("default".to_string()),
@@ -694,7 +694,7 @@ async fn gateway_executes_kiro_claude_cli_sync_via_local_provider_catalog_candid
Some(5),
Some(4_102_444_800),
Some(serde_json::json!(["claude", "kiro"])),
Some(serde_json::json!(["claude:cli"])),
Some(serde_json::json!(["claude:messages"])),
Some(serde_json::json!(["claude-sonnet-4"])),
)
.expect("auth snapshot should build")
@@ -708,7 +708,7 @@ async fn gateway_executes_kiro_claude_cli_sync_via_local_provider_catalog_candid
provider_priority: 10,
provider_is_active: true,
endpoint_id: "endpoint-kiro-cli-local-refresh-1".to_string(),
endpoint_api_format: "claude:cli".to_string(),
endpoint_api_format: "claude:messages".to_string(),
endpoint_api_family: Some("claude".to_string()),
endpoint_kind: Some("cli".to_string()),
endpoint_is_active: true,
@@ -716,11 +716,11 @@ async fn gateway_executes_kiro_claude_cli_sync_via_local_provider_catalog_candid
key_name: "prod".to_string(),
key_auth_type: "bearer".to_string(),
key_is_active: true,
key_api_formats: Some(vec!["claude:cli".to_string()]),
key_api_formats: Some(vec!["claude:messages".to_string()]),
key_allowed_models: None,
key_capabilities: None,
key_internal_priority: 5,
key_global_priority_by_format: Some(serde_json::json!({"claude:cli": 1})),
key_global_priority_by_format: Some(serde_json::json!({"claude:messages": 1})),
model_id: "model-kiro-cli-local-refresh-1".to_string(),
global_model_id: "global-model-kiro-cli-local-refresh-1".to_string(),
global_model_name: "claude-sonnet-4".to_string(),
@@ -730,7 +730,7 @@ async fn gateway_executes_kiro_claude_cli_sync_via_local_provider_catalog_candid
model_provider_model_mappings: Some(vec![StoredProviderModelMapping {
name: "claude-sonnet-4-upstream".to_string(),
priority: 1,
api_formats: Some(vec!["claude:cli".to_string()]),
api_formats: Some(vec!["claude:messages".to_string()]),
}]),
model_supports_streaming: Some(true),
model_is_active: true,
@@ -763,7 +763,7 @@ async fn gateway_executes_kiro_claude_cli_sync_via_local_provider_catalog_candid
StoredProviderCatalogEndpoint::new(
"endpoint-kiro-cli-local-refresh-1".to_string(),
"provider-kiro-cli-local-refresh-1".to_string(),
"claude:cli".to_string(),
"claude:messages".to_string(),
Some("claude".to_string()),
Some("cli".to_string()),
true,
@@ -810,7 +810,7 @@ async fn gateway_executes_kiro_claude_cli_sync_via_local_provider_catalog_candid
)
.expect("key should build")
.with_transport_fields(
Some(serde_json::json!(["claude:cli"])),
Some(serde_json::json!(["claude:messages"])),
encrypt_python_fernet_plaintext(DEVELOPMENT_ENCRYPTION_KEY, "__placeholder__")
.expect("api key should encrypt"),
Some(
@@ -821,7 +821,7 @@ async fn gateway_executes_kiro_claude_cli_sync_via_local_provider_catalog_candid
.expect("auth config should encrypt"),
),
None,
Some(serde_json::json!({"claude:cli": 1})),
Some(serde_json::json!({"claude:messages": 1})),
None,
None,
None,
@@ -873,7 +873,7 @@ async fn gateway_executes_kiro_claude_cli_sync_via_local_provider_catalog_candid
"route_class": "ai_public",
"route_family": "claude",
"route_kind": "cli",
"auth_endpoint_signature": "claude:cli",
"auth_endpoint_signature": "claude:messages",
"execution_runtime_candidate": true,
"auth_context": {
"user_id": "user-kiro-cli-local-refresh-123",
@@ -44,7 +44,7 @@ async fn gateway_executes_claude_chat_sync_via_local_decision_gate_with_local_sy
true,
false,
Some(serde_json::json!(["claude"])),
Some(serde_json::json!(["claude:chat"])),
Some(serde_json::json!(["claude:messages"])),
Some(serde_json::json!(["claude-sonnet-4-5"])),
api_key_id.to_string(),
Some("default".to_string()),
@@ -55,7 +55,7 @@ async fn gateway_executes_claude_chat_sync_via_local_decision_gate_with_local_sy
Some(5),
Some(4_102_444_800),
Some(serde_json::json!(["claude"])),
Some(serde_json::json!(["claude:chat"])),
Some(serde_json::json!(["claude:messages"])),
Some(serde_json::json!(["claude-sonnet-4-5"])),
)
.expect("auth snapshot should build")
@@ -69,7 +69,7 @@ async fn gateway_executes_claude_chat_sync_via_local_decision_gate_with_local_sy
provider_priority: 10,
provider_is_active: true,
endpoint_id: "endpoint-claude-local-1".to_string(),
endpoint_api_format: "claude:chat".to_string(),
endpoint_api_format: "claude:messages".to_string(),
endpoint_api_family: Some("claude".to_string()),
endpoint_kind: Some("chat".to_string()),
endpoint_is_active: true,
@@ -77,11 +77,11 @@ async fn gateway_executes_claude_chat_sync_via_local_decision_gate_with_local_sy
key_name: "prod".to_string(),
key_auth_type: "api_key".to_string(),
key_is_active: true,
key_api_formats: Some(vec!["claude:chat".to_string()]),
key_api_formats: Some(vec!["claude:messages".to_string()]),
key_allowed_models: None,
key_capabilities: None,
key_internal_priority: 5,
key_global_priority_by_format: Some(serde_json::json!({"claude:chat": 1})),
key_global_priority_by_format: Some(serde_json::json!({"claude:messages": 1})),
model_id: "model-claude-local-1".to_string(),
global_model_id: "global-model-claude-local-1".to_string(),
global_model_name: "claude-sonnet-4-5".to_string(),
@@ -91,7 +91,7 @@ async fn gateway_executes_claude_chat_sync_via_local_decision_gate_with_local_sy
model_provider_model_mappings: Some(vec![StoredProviderModelMapping {
name: "claude-sonnet-4-5-upstream".to_string(),
priority: 1,
api_formats: Some(vec!["claude:chat".to_string()]),
api_formats: Some(vec!["claude:messages".to_string()]),
}]),
model_supports_streaming: Some(true),
model_is_active: true,
@@ -124,7 +124,7 @@ async fn gateway_executes_claude_chat_sync_via_local_decision_gate_with_local_sy
StoredProviderCatalogEndpoint::new(
"endpoint-claude-local-1".to_string(),
"provider-claude-local-1".to_string(),
"claude:chat".to_string(),
"claude:messages".to_string(),
Some("claude".to_string()),
Some("chat".to_string()),
true,
@@ -159,12 +159,12 @@ async fn gateway_executes_claude_chat_sync_via_local_decision_gate_with_local_sy
)
.expect("key should build")
.with_transport_fields(
Some(serde_json::json!(["claude:chat"])),
Some(serde_json::json!(["claude:messages"])),
encrypt_python_fernet_plaintext(DEVELOPMENT_ENCRYPTION_KEY, "sk-upstream-claude-chat")
.expect("api key should encrypt"),
None,
None,
Some(serde_json::json!({"claude:chat": 1})),
Some(serde_json::json!({"claude:messages": 1})),
None,
None,
Some(serde_json::json!({"enabled": true, "node_id":"proxy-node-claude-chat-local"})),
@@ -470,7 +470,7 @@ async fn gateway_surfaces_candidate_list_empty_reason_for_claude_chat_runtime_mi
true,
false,
Some(serde_json::json!(["claude"])),
Some(serde_json::json!(["claude:chat"])),
Some(serde_json::json!(["claude:messages"])),
Some(serde_json::json!(["claude-sonnet-4-5"])),
api_key_id.to_string(),
Some("default".to_string()),
@@ -481,7 +481,7 @@ async fn gateway_surfaces_candidate_list_empty_reason_for_claude_chat_runtime_mi
Some(5),
Some(4_102_444_800),
Some(serde_json::json!(["claude"])),
Some(serde_json::json!(["claude:chat"])),
Some(serde_json::json!(["claude:messages"])),
Some(serde_json::json!(["claude-sonnet-4-5"])),
)
.expect("auth snapshot should build")
@@ -595,7 +595,7 @@ async fn gateway_returns_claude_chat_error_for_local_sync_failure() {
true,
false,
Some(serde_json::json!(["claude"])),
Some(serde_json::json!(["claude:chat"])),
Some(serde_json::json!(["claude:messages"])),
Some(serde_json::json!(["claude-sonnet-4-5"])),
api_key_id.to_string(),
Some("default".to_string()),
@@ -606,7 +606,7 @@ async fn gateway_returns_claude_chat_error_for_local_sync_failure() {
Some(5),
Some(4_102_444_800),
Some(serde_json::json!(["claude"])),
Some(serde_json::json!(["claude:chat"])),
Some(serde_json::json!(["claude:messages"])),
Some(serde_json::json!(["claude-sonnet-4-5"])),
)
.expect("auth snapshot should build")
@@ -620,7 +620,7 @@ async fn gateway_returns_claude_chat_error_for_local_sync_failure() {
provider_priority: 10,
provider_is_active: true,
endpoint_id: "endpoint-claude-local-1".to_string(),
endpoint_api_format: "claude:chat".to_string(),
endpoint_api_format: "claude:messages".to_string(),
endpoint_api_family: Some("claude".to_string()),
endpoint_kind: Some("chat".to_string()),
endpoint_is_active: true,
@@ -628,11 +628,11 @@ async fn gateway_returns_claude_chat_error_for_local_sync_failure() {
key_name: "prod".to_string(),
key_auth_type: "api_key".to_string(),
key_is_active: true,
key_api_formats: Some(vec!["claude:chat".to_string()]),
key_api_formats: Some(vec!["claude:messages".to_string()]),
key_allowed_models: None,
key_capabilities: None,
key_internal_priority: 5,
key_global_priority_by_format: Some(serde_json::json!({"claude:chat": 1})),
key_global_priority_by_format: Some(serde_json::json!({"claude:messages": 1})),
model_id: "model-claude-local-1".to_string(),
global_model_id: "global-model-claude-local-1".to_string(),
global_model_name: "claude-sonnet-4-5".to_string(),
@@ -642,7 +642,7 @@ async fn gateway_returns_claude_chat_error_for_local_sync_failure() {
model_provider_model_mappings: Some(vec![StoredProviderModelMapping {
name: "claude-sonnet-4-5-upstream".to_string(),
priority: 1,
api_formats: Some(vec!["claude:chat".to_string()]),
api_formats: Some(vec!["claude:messages".to_string()]),
}]),
model_supports_streaming: Some(true),
model_is_active: true,
@@ -675,7 +675,7 @@ async fn gateway_returns_claude_chat_error_for_local_sync_failure() {
StoredProviderCatalogEndpoint::new(
"endpoint-claude-local-1".to_string(),
"provider-claude-local-1".to_string(),
"claude:chat".to_string(),
"claude:messages".to_string(),
Some("claude".to_string()),
Some("chat".to_string()),
true,
@@ -710,12 +710,12 @@ async fn gateway_returns_claude_chat_error_for_local_sync_failure() {
)
.expect("key should build")
.with_transport_fields(
Some(serde_json::json!(["claude:chat"])),
Some(serde_json::json!(["claude:messages"])),
encrypt_python_fernet_plaintext(DEVELOPMENT_ENCRYPTION_KEY, "sk-upstream-claude-chat")
.expect("api key should encrypt"),
None,
None,
Some(serde_json::json!({"claude:chat": 1})),
Some(serde_json::json!({"claude:messages": 1})),
None,
None,
Some(serde_json::json!({"enabled": true, "node_id":"proxy-node-claude-chat-local"})),
@@ -44,7 +44,7 @@ async fn gateway_executes_claude_cli_sync_via_local_decision_gate_with_local_syn
true,
false,
Some(serde_json::json!(["claude"])),
Some(serde_json::json!(["claude:cli"])),
Some(serde_json::json!(["claude:messages"])),
Some(serde_json::json!(["claude-code"])),
api_key_id.to_string(),
Some("default".to_string()),
@@ -55,7 +55,7 @@ async fn gateway_executes_claude_cli_sync_via_local_decision_gate_with_local_syn
Some(5),
Some(4_102_444_800),
Some(serde_json::json!(["claude"])),
Some(serde_json::json!(["claude:cli"])),
Some(serde_json::json!(["claude:messages"])),
Some(serde_json::json!(["claude-code"])),
)
.expect("auth snapshot should build")
@@ -69,7 +69,7 @@ async fn gateway_executes_claude_cli_sync_via_local_decision_gate_with_local_syn
provider_priority: 10,
provider_is_active: true,
endpoint_id: "endpoint-claude-cli-local-1".to_string(),
endpoint_api_format: "claude:cli".to_string(),
endpoint_api_format: "claude:messages".to_string(),
endpoint_api_family: Some("claude".to_string()),
endpoint_kind: Some("cli".to_string()),
endpoint_is_active: true,
@@ -77,11 +77,11 @@ async fn gateway_executes_claude_cli_sync_via_local_decision_gate_with_local_syn
key_name: "prod".to_string(),
key_auth_type: "bearer".to_string(),
key_is_active: true,
key_api_formats: Some(vec!["claude:cli".to_string()]),
key_api_formats: Some(vec!["claude:messages".to_string()]),
key_allowed_models: None,
key_capabilities: None,
key_internal_priority: 5,
key_global_priority_by_format: Some(serde_json::json!({"claude:cli": 1})),
key_global_priority_by_format: Some(serde_json::json!({"claude:messages": 1})),
model_id: "model-claude-cli-local-1".to_string(),
global_model_id: "global-model-claude-cli-local-1".to_string(),
global_model_name: "claude-code".to_string(),
@@ -91,7 +91,7 @@ async fn gateway_executes_claude_cli_sync_via_local_decision_gate_with_local_syn
model_provider_model_mappings: Some(vec![StoredProviderModelMapping {
name: "claude-code-upstream".to_string(),
priority: 1,
api_formats: Some(vec!["claude:cli".to_string()]),
api_formats: Some(vec!["claude:messages".to_string()]),
}]),
model_supports_streaming: Some(true),
model_is_active: true,
@@ -124,7 +124,7 @@ async fn gateway_executes_claude_cli_sync_via_local_decision_gate_with_local_syn
StoredProviderCatalogEndpoint::new(
"endpoint-claude-cli-local-1".to_string(),
"provider-claude-cli-local-1".to_string(),
"claude:cli".to_string(),
"claude:messages".to_string(),
Some("claude".to_string()),
Some("cli".to_string()),
true,
@@ -159,12 +159,12 @@ async fn gateway_executes_claude_cli_sync_via_local_decision_gate_with_local_syn
)
.expect("key should build")
.with_transport_fields(
Some(serde_json::json!(["claude:cli"])),
Some(serde_json::json!(["claude:messages"])),
encrypt_python_fernet_plaintext(DEVELOPMENT_ENCRYPTION_KEY, "sk-upstream-claude-cli")
.expect("api key should encrypt"),
None,
None,
Some(serde_json::json!({"claude:cli": 1})),
Some(serde_json::json!({"claude:messages": 1})),
None,
None,
Some(serde_json::json!({"enabled": true, "node_id":"proxy-node-claude-cli-local"})),
@@ -478,7 +478,7 @@ async fn gateway_returns_claude_cli_error_for_local_sync_failure() {
true,
false,
Some(serde_json::json!(["claude"])),
Some(serde_json::json!(["claude:cli"])),
Some(serde_json::json!(["claude:messages"])),
Some(serde_json::json!(["claude-code"])),
api_key_id.to_string(),
Some("default".to_string()),
@@ -489,7 +489,7 @@ async fn gateway_returns_claude_cli_error_for_local_sync_failure() {
Some(5),
Some(4_102_444_800),
Some(serde_json::json!(["claude"])),
Some(serde_json::json!(["claude:cli"])),
Some(serde_json::json!(["claude:messages"])),
Some(serde_json::json!(["claude-code"])),
)
.expect("auth snapshot should build")
@@ -503,7 +503,7 @@ async fn gateway_returns_claude_cli_error_for_local_sync_failure() {
provider_priority: 10,
provider_is_active: true,
endpoint_id: "endpoint-claude-cli-local-1".to_string(),
endpoint_api_format: "claude:cli".to_string(),
endpoint_api_format: "claude:messages".to_string(),
endpoint_api_family: Some("claude".to_string()),
endpoint_kind: Some("cli".to_string()),
endpoint_is_active: true,
@@ -511,11 +511,11 @@ async fn gateway_returns_claude_cli_error_for_local_sync_failure() {
key_name: "prod".to_string(),
key_auth_type: "bearer".to_string(),
key_is_active: true,
key_api_formats: Some(vec!["claude:cli".to_string()]),
key_api_formats: Some(vec!["claude:messages".to_string()]),
key_allowed_models: None,
key_capabilities: None,
key_internal_priority: 5,
key_global_priority_by_format: Some(serde_json::json!({"claude:cli": 1})),
key_global_priority_by_format: Some(serde_json::json!({"claude:messages": 1})),
model_id: "model-claude-cli-local-1".to_string(),
global_model_id: "global-model-claude-cli-local-1".to_string(),
global_model_name: "claude-code".to_string(),
@@ -525,7 +525,7 @@ async fn gateway_returns_claude_cli_error_for_local_sync_failure() {
model_provider_model_mappings: Some(vec![StoredProviderModelMapping {
name: "claude-code-upstream".to_string(),
priority: 1,
api_formats: Some(vec!["claude:cli".to_string()]),
api_formats: Some(vec!["claude:messages".to_string()]),
}]),
model_supports_streaming: Some(true),
model_is_active: true,
@@ -558,7 +558,7 @@ async fn gateway_returns_claude_cli_error_for_local_sync_failure() {
StoredProviderCatalogEndpoint::new(
"endpoint-claude-cli-local-1".to_string(),
"provider-claude-cli-local-1".to_string(),
"claude:cli".to_string(),
"claude:messages".to_string(),
Some("claude".to_string()),
Some("cli".to_string()),
true,
@@ -593,12 +593,12 @@ async fn gateway_returns_claude_cli_error_for_local_sync_failure() {
)
.expect("key should build")
.with_transport_fields(
Some(serde_json::json!(["claude:cli"])),
Some(serde_json::json!(["claude:messages"])),
encrypt_python_fernet_plaintext(DEVELOPMENT_ENCRYPTION_KEY, "sk-upstream-claude-cli")
.expect("api key should encrypt"),
None,
None,
Some(serde_json::json!({"claude:cli": 1})),
Some(serde_json::json!({"claude:messages": 1})),
None,
None,
Some(serde_json::json!({"enabled": true, "node_id":"proxy-node-claude-cli-local"})),
@@ -752,7 +752,7 @@ async fn gateway_marks_claude_cli_cross_format_runtime_miss_when_format_conversi
true,
false,
None,
Some(serde_json::json!(["claude:cli"])),
Some(serde_json::json!(["claude:messages"])),
Some(serde_json::json!(["gpt-5.4"])),
api_key_id.to_string(),
Some("default".to_string()),
@@ -763,7 +763,7 @@ async fn gateway_marks_claude_cli_cross_format_runtime_miss_when_format_conversi
Some(5),
Some(4_102_444_800),
None,
Some(serde_json::json!(["claude:cli"])),
Some(serde_json::json!(["claude:messages"])),
Some(serde_json::json!(["gpt-5.4"])),
)
.expect("auth snapshot should build")