clean up legacy openai cli adapter names

This commit is contained in:
fawney19
2026-04-26 21:12:57 +08:00
parent 5b914aa78c
commit ea3dc3257e
47 changed files with 412 additions and 572 deletions

View File

@@ -585,7 +585,7 @@ async fn gateway_locally_denies_claude_messages_stream_after_execution_runtime_m
}
#[tokio::test]
async fn gateway_locally_denies_openai_compact_after_execution_runtime_miss_without_control_execute_opt_in(
async fn gateway_locally_denies_openai_responses_compact_after_execution_runtime_miss_without_control_execute_opt_in(
) {
assert_ai_route_locally_denied_after_execution_runtime_miss(
"/v1/responses/compact",
@@ -599,7 +599,7 @@ async fn gateway_locally_denies_openai_compact_after_execution_runtime_miss_with
}
#[tokio::test]
async fn gateway_locally_denies_openai_compact_stream_after_execution_runtime_miss_without_control_execute_opt_in(
async fn gateway_locally_denies_openai_responses_compact_stream_after_execution_runtime_miss_without_control_execute_opt_in(
) {
assert_ai_route_locally_denied_after_execution_runtime_miss(
"/v1/responses/compact",

View File

@@ -26,8 +26,8 @@ use aether_data_contracts::repository::provider_catalog::{
use sha2::{Digest, Sha256};
#[tokio::test]
async fn gateway_executes_openai_compact_openai_family_upstream_stream_via_local_finalize_response()
{
async fn gateway_executes_openai_responses_compact_openai_family_upstream_stream_via_local_finalize_response(
) {
use base64::Engine as _;
#[derive(Debug, Clone)]
@@ -56,7 +56,7 @@ async fn gateway_executes_openai_compact_openai_family_upstream_stream_via_local
true,
false,
Some(serde_json::json!(["openai"])),
Some(serde_json::json!(["openai:compact"])),
Some(serde_json::json!(["openai:responses:compact"])),
Some(serde_json::json!(["gpt-5"])),
api_key_id.to_string(),
Some("default".to_string()),
@@ -67,7 +67,7 @@ async fn gateway_executes_openai_compact_openai_family_upstream_stream_via_local
Some(5),
Some(4_102_444_800_i64),
Some(serde_json::json!(["openai"])),
Some(serde_json::json!(["openai:compact"])),
Some(serde_json::json!(["openai:responses:compact"])),
Some(serde_json::json!(["gpt-5"])),
)
.expect("auth snapshot should build")
@@ -81,7 +81,7 @@ async fn gateway_executes_openai_compact_openai_family_upstream_stream_via_local
provider_priority: 10,
provider_is_active: true,
endpoint_id: "endpoint-openai-compact-finalize-local-1".to_string(),
endpoint_api_format: "openai:compact".to_string(),
endpoint_api_format: "openai:responses:compact".to_string(),
endpoint_api_family: Some("openai".to_string()),
endpoint_kind: Some("compact".to_string()),
endpoint_is_active: true,
@@ -89,11 +89,11 @@ async fn gateway_executes_openai_compact_openai_family_upstream_stream_via_local
key_name: "prod".to_string(),
key_auth_type: "api_key".to_string(),
key_is_active: true,
key_api_formats: Some(vec!["openai:compact".to_string()]),
key_api_formats: Some(vec!["openai:responses:compact".to_string()]),
key_allowed_models: None,
key_capabilities: None,
key_internal_priority: 5,
key_global_priority_by_format: Some(serde_json::json!({"openai:compact": 1})),
key_global_priority_by_format: Some(serde_json::json!({"openai:responses:compact": 1})),
model_id: "model-openai-compact-finalize-local-1".to_string(),
global_model_id: "global-model-openai-compact-finalize-local-1".to_string(),
global_model_name: "gpt-5".to_string(),
@@ -103,7 +103,7 @@ async fn gateway_executes_openai_compact_openai_family_upstream_stream_via_local
model_provider_model_mappings: Some(vec![StoredProviderModelMapping {
name: "gpt-5-upstream".to_string(),
priority: 1,
api_formats: Some(vec!["openai:compact".to_string()]),
api_formats: Some(vec!["openai:responses:compact".to_string()]),
}]),
model_supports_streaming: Some(true),
model_is_active: true,
@@ -136,7 +136,7 @@ async fn gateway_executes_openai_compact_openai_family_upstream_stream_via_local
StoredProviderCatalogEndpoint::new(
"endpoint-openai-compact-finalize-local-1".to_string(),
"provider-openai-compact-finalize-local-1".to_string(),
"openai:compact".to_string(),
"openai:responses:compact".to_string(),
Some("openai".to_string()),
Some("compact".to_string()),
true,
@@ -168,7 +168,7 @@ async fn gateway_executes_openai_compact_openai_family_upstream_stream_via_local
)
.expect("key should build")
.with_transport_fields(
Some(serde_json::json!(["openai:compact"])),
Some(serde_json::json!(["openai:responses:compact"])),
encrypt_python_fernet_plaintext(
DEVELOPMENT_ENCRYPTION_KEY,
"sk-upstream-openai-compact-finalize",
@@ -176,7 +176,7 @@ async fn gateway_executes_openai_compact_openai_family_upstream_stream_via_local
.expect("api key should encrypt"),
None,
None,
Some(serde_json::json!({"openai:compact": 1})),
Some(serde_json::json!({"openai:responses:compact": 1})),
None,
None,
None,

View File

@@ -26,7 +26,8 @@ use aether_data_contracts::repository::provider_catalog::{
use sha2::{Digest, Sha256};
#[tokio::test]
async fn gateway_executes_openai_cli_cross_format_upstream_stream_via_local_finalize_response() {
async fn gateway_executes_openai_responses_cross_format_upstream_stream_via_local_finalize_response(
) {
use base64::Engine as _;
#[derive(Debug, Clone)]
@@ -56,7 +57,7 @@ async fn gateway_executes_openai_cli_cross_format_upstream_stream_via_local_fina
true,
false,
Some(serde_json::json!(["openai", "gemini"])),
Some(serde_json::json!(["openai:cli"])),
Some(serde_json::json!(["openai:responses"])),
Some(serde_json::json!(["gpt-5"])),
api_key_id.to_string(),
Some("default".to_string()),
@@ -67,7 +68,7 @@ async fn gateway_executes_openai_cli_cross_format_upstream_stream_via_local_fina
Some(5),
Some(4_102_444_800_i64),
Some(serde_json::json!(["openai", "gemini"])),
Some(serde_json::json!(["openai:cli"])),
Some(serde_json::json!(["openai:responses"])),
Some(serde_json::json!(["gpt-5"])),
)
.expect("auth snapshot should build")
@@ -483,7 +484,7 @@ async fn gateway_executes_openai_cli_cross_format_upstream_stream_via_local_fina
}
#[tokio::test]
async fn gateway_executes_openai_cli_cross_format_function_call_upstream_stream_via_local_finalize_response(
async fn gateway_executes_openai_responses_cross_format_function_call_upstream_stream_via_local_finalize_response(
) {
use base64::Engine as _;
@@ -514,7 +515,7 @@ async fn gateway_executes_openai_cli_cross_format_function_call_upstream_stream_
true,
false,
Some(serde_json::json!(["openai", "gemini"])),
Some(serde_json::json!(["openai:cli"])),
Some(serde_json::json!(["openai:responses"])),
Some(serde_json::json!(["gpt-5"])),
api_key_id.to_string(),
Some("default".to_string()),
@@ -525,7 +526,7 @@ async fn gateway_executes_openai_cli_cross_format_function_call_upstream_stream_
Some(5),
Some(4_102_444_800_i64),
Some(serde_json::json!(["openai", "gemini"])),
Some(serde_json::json!(["openai:cli"])),
Some(serde_json::json!(["openai:responses"])),
Some(serde_json::json!(["gpt-5"])),
)
.expect("auth snapshot should build")
@@ -939,7 +940,7 @@ async fn gateway_executes_openai_cli_cross_format_function_call_upstream_stream_
}
#[tokio::test]
async fn gateway_executes_openai_cli_antigravity_cross_format_upstream_stream_via_local_finalize_response(
async fn gateway_executes_openai_responses_antigravity_cross_format_upstream_stream_via_local_finalize_response(
) {
use base64::Engine as _;
@@ -984,7 +985,7 @@ async fn gateway_executes_openai_cli_antigravity_cross_format_upstream_stream_vi
true,
false,
Some(serde_json::json!(["openai", "antigravity"])),
Some(serde_json::json!(["openai:cli"])),
Some(serde_json::json!(["openai:responses"])),
Some(serde_json::json!(["gpt-5"])),
api_key_id.to_string(),
Some("default".to_string()),
@@ -995,7 +996,7 @@ async fn gateway_executes_openai_cli_antigravity_cross_format_upstream_stream_vi
Some(5),
Some(4_102_444_800_i64),
Some(serde_json::json!(["openai", "antigravity"])),
Some(serde_json::json!(["openai:cli"])),
Some(serde_json::json!(["openai:responses"])),
Some(serde_json::json!(["gpt-5"])),
)
.expect("auth snapshot should build")

View File

@@ -26,7 +26,7 @@ use aether_data_contracts::repository::provider_catalog::{
use sha2::{Digest, Sha256};
#[tokio::test]
async fn gateway_executes_openai_cli_sync_upstream_stream_via_local_finalize_response() {
async fn gateway_executes_openai_responses_sync_upstream_stream_via_local_finalize_response() {
use base64::Engine as _;
#[derive(Debug, Clone)]
@@ -55,7 +55,7 @@ async fn gateway_executes_openai_cli_sync_upstream_stream_via_local_finalize_res
true,
false,
Some(serde_json::json!(["openai"])),
Some(serde_json::json!(["openai:cli"])),
Some(serde_json::json!(["openai:responses"])),
Some(serde_json::json!(["gpt-5"])),
api_key_id.to_string(),
Some("default".to_string()),
@@ -66,7 +66,7 @@ async fn gateway_executes_openai_cli_sync_upstream_stream_via_local_finalize_res
Some(5),
Some(4_102_444_800_i64),
Some(serde_json::json!(["openai"])),
Some(serde_json::json!(["openai:cli"])),
Some(serde_json::json!(["openai:responses"])),
Some(serde_json::json!(["gpt-5"])),
)
.expect("auth snapshot should build")
@@ -80,7 +80,7 @@ async fn gateway_executes_openai_cli_sync_upstream_stream_via_local_finalize_res
provider_priority: 10,
provider_is_active: true,
endpoint_id: "endpoint-openai-cli-finalize-local-1".to_string(),
endpoint_api_format: "openai:cli".to_string(),
endpoint_api_format: "openai:responses".to_string(),
endpoint_api_family: Some("openai".to_string()),
endpoint_kind: Some("cli".to_string()),
endpoint_is_active: true,
@@ -88,11 +88,11 @@ async fn gateway_executes_openai_cli_sync_upstream_stream_via_local_finalize_res
key_name: "prod".to_string(),
key_auth_type: "bearer".to_string(),
key_is_active: true,
key_api_formats: Some(vec!["openai:cli".to_string()]),
key_api_formats: Some(vec!["openai:responses".to_string()]),
key_allowed_models: None,
key_capabilities: None,
key_internal_priority: 5,
key_global_priority_by_format: Some(serde_json::json!({"openai:cli": 1})),
key_global_priority_by_format: Some(serde_json::json!({"openai:responses": 1})),
model_id: "model-openai-cli-finalize-local-1".to_string(),
global_model_id: "global-model-openai-cli-finalize-local-1".to_string(),
global_model_name: "gpt-5".to_string(),
@@ -102,7 +102,7 @@ async fn gateway_executes_openai_cli_sync_upstream_stream_via_local_finalize_res
model_provider_model_mappings: Some(vec![StoredProviderModelMapping {
name: "gpt-5-upstream".to_string(),
priority: 1,
api_formats: Some(vec!["openai:cli".to_string()]),
api_formats: Some(vec!["openai:responses".to_string()]),
}]),
model_supports_streaming: Some(true),
model_is_active: true,
@@ -135,7 +135,7 @@ async fn gateway_executes_openai_cli_sync_upstream_stream_via_local_finalize_res
StoredProviderCatalogEndpoint::new(
"endpoint-openai-cli-finalize-local-1".to_string(),
"provider-openai-cli-finalize-local-1".to_string(),
"openai:cli".to_string(),
"openai:responses".to_string(),
Some("openai".to_string()),
Some("cli".to_string()),
true,
@@ -167,7 +167,7 @@ async fn gateway_executes_openai_cli_sync_upstream_stream_via_local_finalize_res
)
.expect("key should build")
.with_transport_fields(
Some(serde_json::json!(["openai:cli"])),
Some(serde_json::json!(["openai:responses"])),
encrypt_python_fernet_plaintext(
DEVELOPMENT_ENCRYPTION_KEY,
"sk-upstream-openai-cli-finalize",
@@ -175,7 +175,7 @@ async fn gateway_executes_openai_cli_sync_upstream_stream_via_local_finalize_res
.expect("api key should encrypt"),
None,
None,
Some(serde_json::json!({"openai:cli": 1})),
Some(serde_json::json!({"openai:responses": 1})),
None,
None,
None,

View File

@@ -441,7 +441,7 @@ async fn gateway_executes_openai_chat_stream_via_local_decision_gate_without_exe
}
#[tokio::test]
async fn gateway_executes_openai_chat_stream_via_local_openai_cli_cross_format_candidate() {
async fn gateway_executes_openai_chat_stream_via_local_openai_responses_cross_format_candidate() {
#[derive(Debug, Clone)]
struct SeenExecutionRuntimeStreamRequest {
trace_id: String,
@@ -499,7 +499,7 @@ async fn gateway_executes_openai_chat_stream_via_local_openai_cli_cross_format_c
provider_priority: 10,
provider_is_active: true,
endpoint_id: "endpoint-openai-chat-cli-local-1".to_string(),
endpoint_api_format: "openai:cli".to_string(),
endpoint_api_format: "openai:responses".to_string(),
endpoint_api_family: Some("openai".to_string()),
endpoint_kind: Some("cli".to_string()),
endpoint_is_active: true,
@@ -507,11 +507,11 @@ async fn gateway_executes_openai_chat_stream_via_local_openai_cli_cross_format_c
key_name: "prod".to_string(),
key_auth_type: "api_key".to_string(),
key_is_active: true,
key_api_formats: Some(vec!["openai:cli".to_string()]),
key_api_formats: Some(vec!["openai:responses".to_string()]),
key_allowed_models: None,
key_capabilities: None,
key_internal_priority: 5,
key_global_priority_by_format: Some(serde_json::json!({"openai:cli": 1})),
key_global_priority_by_format: Some(serde_json::json!({"openai:responses": 1})),
model_id: "model-openai-chat-cli-local-1".to_string(),
global_model_id: "global-model-openai-chat-cli-local-1".to_string(),
global_model_name: "gpt-5.4".to_string(),
@@ -521,7 +521,7 @@ async fn gateway_executes_openai_chat_stream_via_local_openai_cli_cross_format_c
model_provider_model_mappings: Some(vec![StoredProviderModelMapping {
name: "gpt-5.4".to_string(),
priority: 1,
api_formats: Some(vec!["openai:cli".to_string()]),
api_formats: Some(vec!["openai:responses".to_string()]),
}]),
model_supports_streaming: Some(true),
model_is_active: true,
@@ -554,7 +554,7 @@ async fn gateway_executes_openai_chat_stream_via_local_openai_cli_cross_format_c
StoredProviderCatalogEndpoint::new(
"endpoint-openai-chat-cli-local-1".to_string(),
"provider-openai-chat-cli-local-1".to_string(),
"openai:cli".to_string(),
"openai:responses".to_string(),
Some("openai".to_string()),
Some("cli".to_string()),
true,
@@ -584,7 +584,7 @@ async fn gateway_executes_openai_chat_stream_via_local_openai_cli_cross_format_c
)
.expect("key should build")
.with_transport_fields(
Some(serde_json::json!(["openai:cli"])),
Some(serde_json::json!(["openai:responses"])),
encrypt_python_fernet_plaintext(
DEVELOPMENT_ENCRYPTION_KEY,
"sk-upstream-openai-chat-cli",
@@ -592,7 +592,7 @@ async fn gateway_executes_openai_chat_stream_via_local_openai_cli_cross_format_c
.expect("api key should encrypt"),
None,
None,
Some(serde_json::json!({"openai:cli": 1})),
Some(serde_json::json!({"openai:responses": 1})),
None,
None,
None,
@@ -909,7 +909,7 @@ async fn gateway_executes_openai_chat_stream_via_local_openai_cli_cross_format_c
assert_eq!(extra_data["execution_strategy"], "local_cross_format");
assert_eq!(extra_data["conversion_mode"], "bidirectional");
assert_eq!(extra_data["client_contract"], "openai:chat");
assert_eq!(extra_data["provider_contract"], "openai:cli");
assert_eq!(extra_data["provider_contract"], "openai:responses");
tokio::time::sleep(std::time::Duration::from_millis(100)).await;
assert!(

View File

@@ -23,8 +23,8 @@ use aether_data_contracts::repository::provider_catalog::{
use sha2::{Digest, Sha256};
#[tokio::test]
async fn gateway_executes_openai_compact_stream_via_local_decision_gate_with_local_stream_decision()
{
async fn gateway_executes_openai_responses_compact_stream_via_local_decision_gate_with_local_stream_decision(
) {
#[derive(Debug, Clone)]
struct SeenExecutionRuntimeStreamRequest {
trace_id: String,
@@ -62,7 +62,7 @@ async fn gateway_executes_openai_compact_stream_via_local_decision_gate_with_loc
true,
false,
Some(serde_json::json!(["openai"])),
Some(serde_json::json!(["openai:compact"])),
Some(serde_json::json!(["openai:responses:compact"])),
Some(serde_json::json!(["gpt-5"])),
api_key_id.to_string(),
Some("default".to_string()),
@@ -73,7 +73,7 @@ async fn gateway_executes_openai_compact_stream_via_local_decision_gate_with_loc
Some(5),
Some(4_102_444_800_i64),
Some(serde_json::json!(["openai"])),
Some(serde_json::json!(["openai:compact"])),
Some(serde_json::json!(["openai:responses:compact"])),
Some(serde_json::json!(["gpt-5"])),
)
.expect("auth snapshot should build")
@@ -87,7 +87,7 @@ async fn gateway_executes_openai_compact_stream_via_local_decision_gate_with_loc
provider_priority: 10,
provider_is_active: true,
endpoint_id: "endpoint-openai-compact-local-1".to_string(),
endpoint_api_format: "openai:compact".to_string(),
endpoint_api_format: "openai:responses:compact".to_string(),
endpoint_api_family: Some("openai".to_string()),
endpoint_kind: Some("compact".to_string()),
endpoint_is_active: true,
@@ -95,11 +95,11 @@ async fn gateway_executes_openai_compact_stream_via_local_decision_gate_with_loc
key_name: "prod".to_string(),
key_auth_type: "bearer".to_string(),
key_is_active: true,
key_api_formats: Some(vec!["openai:compact".to_string()]),
key_api_formats: Some(vec!["openai:responses:compact".to_string()]),
key_allowed_models: None,
key_capabilities: None,
key_internal_priority: 5,
key_global_priority_by_format: Some(serde_json::json!({"openai:compact": 1})),
key_global_priority_by_format: Some(serde_json::json!({"openai:responses:compact": 1})),
model_id: "model-openai-compact-local-1".to_string(),
global_model_id: "global-model-openai-compact-local-1".to_string(),
global_model_name: "gpt-5".to_string(),
@@ -109,7 +109,7 @@ async fn gateway_executes_openai_compact_stream_via_local_decision_gate_with_loc
model_provider_model_mappings: Some(vec![StoredProviderModelMapping {
name: "gpt-5-upstream".to_string(),
priority: 1,
api_formats: Some(vec!["openai:compact".to_string()]),
api_formats: Some(vec!["openai:responses:compact".to_string()]),
}]),
model_supports_streaming: Some(true),
model_is_active: true,
@@ -142,7 +142,7 @@ async fn gateway_executes_openai_compact_stream_via_local_decision_gate_with_loc
StoredProviderCatalogEndpoint::new(
"endpoint-openai-compact-local-1".to_string(),
"provider-openai-compact-local-1".to_string(),
"openai:compact".to_string(),
"openai:responses:compact".to_string(),
Some("openai".to_string()),
Some("compact".to_string()),
true,
@@ -183,7 +183,7 @@ async fn gateway_executes_openai_compact_stream_via_local_decision_gate_with_loc
)
.expect("key should build")
.with_transport_fields(
Some(serde_json::json!(["openai:compact"])),
Some(serde_json::json!(["openai:responses:compact"])),
encrypt_python_fernet_plaintext(
DEVELOPMENT_ENCRYPTION_KEY,
"sk-upstream-openai-compact",
@@ -191,7 +191,7 @@ async fn gateway_executes_openai_compact_stream_via_local_decision_gate_with_loc
.expect("api key should encrypt"),
None,
None,
Some(serde_json::json!({"openai:compact": 1})),
Some(serde_json::json!({"openai:responses:compact": 1})),
None,
None,
Some(serde_json::json!({"enabled": true, "node_id":"proxy-node-openai-compact-local"})),
@@ -221,7 +221,7 @@ async fn gateway_executes_openai_compact_stream_via_local_decision_gate_with_loc
"route_class": "ai_public",
"route_family": "openai",
"route_kind": "compact",
"auth_endpoint_signature": "openai:compact",
"auth_endpoint_signature": "openai:responses:compact",
"execution_runtime_candidate": true,
"auth_context": {
"user_id": "user-openai-compact-local-123",

View File

@@ -65,7 +65,7 @@ async fn gateway_executes_codex_cli_stream_via_local_decision_gate_after_oauth_r
true,
false,
Some(serde_json::json!(["openai", "codex"])),
Some(serde_json::json!(["openai:cli"])),
Some(serde_json::json!(["openai:responses"])),
Some(serde_json::json!(["gpt-5.4"])),
api_key_id.to_string(),
Some("default".to_string()),
@@ -76,7 +76,7 @@ async fn gateway_executes_codex_cli_stream_via_local_decision_gate_after_oauth_r
Some(5),
Some(4_102_444_800_i64),
Some(serde_json::json!(["openai", "codex"])),
Some(serde_json::json!(["openai:cli"])),
Some(serde_json::json!(["openai:responses"])),
Some(serde_json::json!(["gpt-5.4"])),
)
.expect("auth snapshot should build")
@@ -90,7 +90,7 @@ async fn gateway_executes_codex_cli_stream_via_local_decision_gate_after_oauth_r
provider_priority: 10,
provider_is_active: true,
endpoint_id: "endpoint-codex-cli-stream-local-1".to_string(),
endpoint_api_format: "openai:cli".to_string(),
endpoint_api_format: "openai:responses".to_string(),
endpoint_api_family: Some("openai".to_string()),
endpoint_kind: Some("cli".to_string()),
endpoint_is_active: true,
@@ -98,11 +98,11 @@ async fn gateway_executes_codex_cli_stream_via_local_decision_gate_after_oauth_r
key_name: "oauth".to_string(),
key_auth_type: "oauth".to_string(),
key_is_active: true,
key_api_formats: Some(vec!["openai:cli".to_string()]),
key_api_formats: Some(vec!["openai:responses".to_string()]),
key_allowed_models: None,
key_capabilities: None,
key_internal_priority: 5,
key_global_priority_by_format: Some(serde_json::json!({"openai:cli": 1})),
key_global_priority_by_format: Some(serde_json::json!({"openai:responses": 1})),
model_id: "model-codex-cli-stream-local-1".to_string(),
global_model_id: "global-model-codex-cli-stream-local-1".to_string(),
global_model_name: "gpt-5.4".to_string(),
@@ -112,7 +112,7 @@ async fn gateway_executes_codex_cli_stream_via_local_decision_gate_after_oauth_r
model_provider_model_mappings: Some(vec![StoredProviderModelMapping {
name: "gpt-5.4".to_string(),
priority: 1,
api_formats: Some(vec!["openai:cli".to_string()]),
api_formats: Some(vec!["openai:responses".to_string()]),
}]),
model_supports_streaming: Some(true),
model_is_active: true,
@@ -145,7 +145,7 @@ async fn gateway_executes_codex_cli_stream_via_local_decision_gate_after_oauth_r
StoredProviderCatalogEndpoint::new(
"endpoint-codex-cli-stream-local-1".to_string(),
"provider-codex-cli-stream-local-1".to_string(),
"openai:cli".to_string(),
"openai:responses".to_string(),
Some("openai".to_string()),
Some("cli".to_string()),
true,
@@ -180,12 +180,12 @@ async fn gateway_executes_codex_cli_stream_via_local_decision_gate_after_oauth_r
)
.expect("key should build")
.with_transport_fields(
Some(serde_json::json!(["openai:cli"])),
Some(serde_json::json!(["openai:responses"])),
encrypt_python_fernet_plaintext(DEVELOPMENT_ENCRYPTION_KEY, "__placeholder__")
.expect("placeholder api key should encrypt"),
Some(encrypted_auth_config),
None,
Some(serde_json::json!({"openai:cli": 1})),
Some(serde_json::json!({"openai:responses": 1})),
None,
None,
None,
@@ -216,7 +216,7 @@ async fn gateway_executes_codex_cli_stream_via_local_decision_gate_after_oauth_r
"route_class": "ai_public",
"route_family": "openai",
"route_kind": "cli",
"auth_endpoint_signature": "openai:cli",
"auth_endpoint_signature": "openai:responses",
"execution_runtime_candidate": true,
"auth_context": {
"user_id": "user-codex-cli-stream-local-123",

View File

@@ -777,7 +777,7 @@ async fn gateway_marks_claude_cli_cross_format_runtime_miss_when_format_conversi
provider_priority: 10,
provider_is_active: true,
endpoint_id: "endpoint-claude-cli-openai-local-miss-1".to_string(),
endpoint_api_format: "openai:cli".to_string(),
endpoint_api_format: "openai:responses".to_string(),
endpoint_api_family: Some("openai".to_string()),
endpoint_kind: Some("cli".to_string()),
endpoint_is_active: true,
@@ -785,11 +785,11 @@ async fn gateway_marks_claude_cli_cross_format_runtime_miss_when_format_conversi
key_name: "codex".to_string(),
key_auth_type: "bearer".to_string(),
key_is_active: true,
key_api_formats: Some(vec!["openai:cli".to_string()]),
key_api_formats: Some(vec!["openai:responses".to_string()]),
key_allowed_models: None,
key_capabilities: None,
key_internal_priority: 5,
key_global_priority_by_format: Some(serde_json::json!({"openai:cli": 1})),
key_global_priority_by_format: Some(serde_json::json!({"openai:responses": 1})),
model_id: "model-claude-cli-openai-local-miss-1".to_string(),
global_model_id: "global-model-claude-cli-openai-local-miss-1".to_string(),
global_model_name: "gpt-5.4".to_string(),
@@ -799,7 +799,7 @@ async fn gateway_marks_claude_cli_cross_format_runtime_miss_when_format_conversi
model_provider_model_mappings: Some(vec![StoredProviderModelMapping {
name: "gpt-5.4".to_string(),
priority: 1,
api_formats: Some(vec!["openai:cli".to_string()]),
api_formats: Some(vec!["openai:responses".to_string()]),
}]),
model_supports_streaming: Some(true),
model_is_active: true,
@@ -832,7 +832,7 @@ async fn gateway_marks_claude_cli_cross_format_runtime_miss_when_format_conversi
StoredProviderCatalogEndpoint::new(
"endpoint-claude-cli-openai-local-miss-1".to_string(),
"provider-claude-cli-openai-local-miss-1".to_string(),
"openai:cli".to_string(),
"openai:responses".to_string(),
Some("openai".to_string()),
Some("cli".to_string()),
true,
@@ -862,7 +862,7 @@ async fn gateway_marks_claude_cli_cross_format_runtime_miss_when_format_conversi
)
.expect("key should build")
.with_transport_fields(
Some(serde_json::json!(["openai:cli"])),
Some(serde_json::json!(["openai:responses"])),
encrypt_python_fernet_plaintext(
DEVELOPMENT_ENCRYPTION_KEY,
"sk-upstream-openai-cli-local-miss",
@@ -870,7 +870,7 @@ async fn gateway_marks_claude_cli_cross_format_runtime_miss_when_format_conversi
.expect("api key should encrypt"),
None,
None,
Some(serde_json::json!({"openai:cli": 1})),
Some(serde_json::json!({"openai:responses": 1})),
None,
None,
None,

View File

@@ -27,7 +27,7 @@ use base64::Engine as _;
use sha2::{Digest, Sha256};
#[tokio::test]
async fn gateway_executes_openai_cli_sync_via_local_decision_gate_with_local_sync_decision() {
async fn gateway_executes_openai_responses_sync_via_local_decision_gate_with_local_sync_decision() {
#[derive(Debug, Clone)]
struct SeenExecutionRuntimeSyncRequest {
trace_id: String,
@@ -62,7 +62,7 @@ async fn gateway_executes_openai_cli_sync_via_local_decision_gate_with_local_syn
true,
false,
Some(serde_json::json!(["openai"])),
Some(serde_json::json!(["openai:cli"])),
Some(serde_json::json!(["openai:responses"])),
Some(serde_json::json!(["gpt-5"])),
api_key_id.to_string(),
Some("default".to_string()),
@@ -73,7 +73,7 @@ async fn gateway_executes_openai_cli_sync_via_local_decision_gate_with_local_syn
Some(5),
Some(4_102_444_800_i64),
Some(serde_json::json!(["openai"])),
Some(serde_json::json!(["openai:cli"])),
Some(serde_json::json!(["openai:responses"])),
Some(serde_json::json!(["gpt-5"])),
)
.expect("auth snapshot should build")
@@ -87,7 +87,7 @@ async fn gateway_executes_openai_cli_sync_via_local_decision_gate_with_local_syn
provider_priority: 10,
provider_is_active: true,
endpoint_id: "endpoint-openai-cli-local-1".to_string(),
endpoint_api_format: "openai:cli".to_string(),
endpoint_api_format: "openai:responses".to_string(),
endpoint_api_family: Some("openai".to_string()),
endpoint_kind: Some("cli".to_string()),
endpoint_is_active: true,
@@ -95,11 +95,11 @@ async fn gateway_executes_openai_cli_sync_via_local_decision_gate_with_local_syn
key_name: "prod".to_string(),
key_auth_type: "api_key".to_string(),
key_is_active: true,
key_api_formats: Some(vec!["openai:cli".to_string()]),
key_api_formats: Some(vec!["openai:responses".to_string()]),
key_allowed_models: None,
key_capabilities: None,
key_internal_priority: 5,
key_global_priority_by_format: Some(serde_json::json!({"openai:cli": 1})),
key_global_priority_by_format: Some(serde_json::json!({"openai:responses": 1})),
model_id: "model-openai-cli-local-1".to_string(),
global_model_id: "global-model-openai-cli-local-1".to_string(),
global_model_name: "gpt-5".to_string(),
@@ -109,7 +109,7 @@ async fn gateway_executes_openai_cli_sync_via_local_decision_gate_with_local_syn
model_provider_model_mappings: Some(vec![StoredProviderModelMapping {
name: "gpt-5-upstream".to_string(),
priority: 1,
api_formats: Some(vec!["openai:cli".to_string()]),
api_formats: Some(vec!["openai:responses".to_string()]),
}]),
model_supports_streaming: Some(true),
model_is_active: true,
@@ -142,7 +142,7 @@ async fn gateway_executes_openai_cli_sync_via_local_decision_gate_with_local_syn
StoredProviderCatalogEndpoint::new(
"endpoint-openai-cli-local-1".to_string(),
"provider-openai-cli-local-1".to_string(),
"openai:cli".to_string(),
"openai:responses".to_string(),
Some("openai".to_string()),
Some("cli".to_string()),
true,
@@ -182,12 +182,12 @@ async fn gateway_executes_openai_cli_sync_via_local_decision_gate_with_local_syn
)
.expect("key should build")
.with_transport_fields(
Some(serde_json::json!(["openai:cli"])),
Some(serde_json::json!(["openai:responses"])),
encrypt_python_fernet_plaintext(DEVELOPMENT_ENCRYPTION_KEY, "sk-upstream-openai-cli")
.expect("api key should encrypt"),
None,
None,
Some(serde_json::json!({"openai:cli": 1})),
Some(serde_json::json!({"openai:responses": 1})),
None,
None,
Some(serde_json::json!({"enabled": true, "node_id":"proxy-node-openai-cli-local"})),
@@ -217,7 +217,7 @@ async fn gateway_executes_openai_cli_sync_via_local_decision_gate_with_local_syn
"route_class": "ai_public",
"route_family": "openai",
"route_kind": "cli",
"auth_endpoint_signature": "openai:cli",
"auth_endpoint_signature": "openai:responses",
"execution_runtime_candidate": true,
"auth_context": {
"user_id": "user-openai-cli-local-123",
@@ -542,7 +542,7 @@ async fn gateway_executes_openai_cli_sync_via_local_decision_gate_with_local_syn
}
#[tokio::test]
async fn gateway_waits_for_api_key_concurrency_slot_then_executes_openai_cli_sync() {
async fn gateway_waits_for_api_key_concurrency_slot_then_executes_openai_responses_sync() {
fn hash_api_key(value: &str) -> String {
let mut hasher = Sha256::new();
hasher.update(value.as_bytes());
@@ -559,7 +559,7 @@ async fn gateway_waits_for_api_key_concurrency_slot_then_executes_openai_cli_syn
true,
false,
Some(serde_json::json!(["openai"])),
Some(serde_json::json!(["openai:cli"])),
Some(serde_json::json!(["openai:responses"])),
Some(serde_json::json!(["gpt-5"])),
api_key_id.to_string(),
Some("default".to_string()),
@@ -570,7 +570,7 @@ async fn gateway_waits_for_api_key_concurrency_slot_then_executes_openai_cli_syn
Some(5),
Some(4_102_444_800),
Some(serde_json::json!(["openai"])),
Some(serde_json::json!(["openai:cli"])),
Some(serde_json::json!(["openai:responses"])),
Some(serde_json::json!(["gpt-5"])),
)
.expect("auth snapshot should build")
@@ -584,7 +584,7 @@ async fn gateway_waits_for_api_key_concurrency_slot_then_executes_openai_cli_syn
provider_priority: 10,
provider_is_active: true,
endpoint_id: "endpoint-openai-cli-local-limit-1".to_string(),
endpoint_api_format: "openai:cli".to_string(),
endpoint_api_format: "openai:responses".to_string(),
endpoint_api_family: Some("openai".to_string()),
endpoint_kind: Some("cli".to_string()),
endpoint_is_active: true,
@@ -592,11 +592,11 @@ async fn gateway_waits_for_api_key_concurrency_slot_then_executes_openai_cli_syn
key_name: "prod".to_string(),
key_auth_type: "api_key".to_string(),
key_is_active: true,
key_api_formats: Some(vec!["openai:cli".to_string()]),
key_api_formats: Some(vec!["openai:responses".to_string()]),
key_allowed_models: None,
key_capabilities: None,
key_internal_priority: 5,
key_global_priority_by_format: Some(serde_json::json!({"openai:cli": 1})),
key_global_priority_by_format: Some(serde_json::json!({"openai:responses": 1})),
model_id: "model-openai-cli-local-limit-1".to_string(),
global_model_id: "global-model-openai-cli-local-limit-1".to_string(),
global_model_name: "gpt-5".to_string(),
@@ -606,7 +606,7 @@ async fn gateway_waits_for_api_key_concurrency_slot_then_executes_openai_cli_syn
model_provider_model_mappings: Some(vec![StoredProviderModelMapping {
name: "gpt-5-upstream".to_string(),
priority: 1,
api_formats: Some(vec!["openai:cli".to_string()]),
api_formats: Some(vec!["openai:responses".to_string()]),
}]),
model_supports_streaming: Some(true),
model_is_active: true,
@@ -639,7 +639,7 @@ async fn gateway_waits_for_api_key_concurrency_slot_then_executes_openai_cli_syn
StoredProviderCatalogEndpoint::new(
"endpoint-openai-cli-local-limit-1".to_string(),
"provider-openai-cli-local-limit-1".to_string(),
"openai:cli".to_string(),
"openai:responses".to_string(),
Some("openai".to_string()),
Some("cli".to_string()),
true,
@@ -669,7 +669,7 @@ async fn gateway_waits_for_api_key_concurrency_slot_then_executes_openai_cli_syn
)
.expect("key should build")
.with_transport_fields(
Some(serde_json::json!(["openai:cli"])),
Some(serde_json::json!(["openai:responses"])),
encrypt_python_fernet_plaintext(
DEVELOPMENT_ENCRYPTION_KEY,
"sk-upstream-openai-cli-limit",
@@ -677,7 +677,7 @@ async fn gateway_waits_for_api_key_concurrency_slot_then_executes_openai_cli_syn
.expect("api key should encrypt"),
None,
None,
Some(serde_json::json!({"openai:cli": 1})),
Some(serde_json::json!({"openai:responses": 1})),
None,
None,
None,
@@ -730,7 +730,7 @@ async fn gateway_waits_for_api_key_concurrency_slot_then_executes_openai_cli_syn
"route_class": "ai_public",
"route_family": "openai",
"route_kind": "cli",
"auth_endpoint_signature": "openai:cli",
"auth_endpoint_signature": "openai:responses",
"execution_runtime_candidate": true,
"auth_context": {
"user_id": "user-openai-cli-local-limit-123",
@@ -924,7 +924,7 @@ async fn gateway_waits_for_api_key_concurrency_slot_then_executes_openai_cli_syn
}
#[tokio::test]
async fn gateway_returns_concurrency_limited_after_wait_budget_expires_for_openai_cli_sync() {
async fn gateway_returns_concurrency_limited_after_wait_budget_expires_for_openai_responses_sync() {
fn hash_api_key(value: &str) -> String {
let mut hasher = Sha256::new();
hasher.update(value.as_bytes());
@@ -941,7 +941,7 @@ async fn gateway_returns_concurrency_limited_after_wait_budget_expires_for_opena
true,
false,
Some(serde_json::json!(["openai"])),
Some(serde_json::json!(["openai:cli"])),
Some(serde_json::json!(["openai:responses"])),
Some(serde_json::json!(["gpt-5"])),
api_key_id.to_string(),
Some("default".to_string()),
@@ -952,7 +952,7 @@ async fn gateway_returns_concurrency_limited_after_wait_budget_expires_for_opena
Some(5),
Some(4_102_444_800),
Some(serde_json::json!(["openai"])),
Some(serde_json::json!(["openai:cli"])),
Some(serde_json::json!(["openai:responses"])),
Some(serde_json::json!(["gpt-5"])),
)
.expect("auth snapshot should build")
@@ -966,7 +966,7 @@ async fn gateway_returns_concurrency_limited_after_wait_budget_expires_for_opena
provider_priority: 10,
provider_is_active: true,
endpoint_id: "endpoint-openai-cli-local-timeout-1".to_string(),
endpoint_api_format: "openai:cli".to_string(),
endpoint_api_format: "openai:responses".to_string(),
endpoint_api_family: Some("openai".to_string()),
endpoint_kind: Some("cli".to_string()),
endpoint_is_active: true,
@@ -974,11 +974,11 @@ async fn gateway_returns_concurrency_limited_after_wait_budget_expires_for_opena
key_name: "prod".to_string(),
key_auth_type: "api_key".to_string(),
key_is_active: true,
key_api_formats: Some(vec!["openai:cli".to_string()]),
key_api_formats: Some(vec!["openai:responses".to_string()]),
key_allowed_models: None,
key_capabilities: None,
key_internal_priority: 5,
key_global_priority_by_format: Some(serde_json::json!({"openai:cli": 1})),
key_global_priority_by_format: Some(serde_json::json!({"openai:responses": 1})),
model_id: "model-openai-cli-local-timeout-1".to_string(),
global_model_id: "global-model-openai-cli-local-timeout-1".to_string(),
global_model_name: "gpt-5".to_string(),
@@ -988,7 +988,7 @@ async fn gateway_returns_concurrency_limited_after_wait_budget_expires_for_opena
model_provider_model_mappings: Some(vec![StoredProviderModelMapping {
name: "gpt-5-upstream".to_string(),
priority: 1,
api_formats: Some(vec!["openai:cli".to_string()]),
api_formats: Some(vec!["openai:responses".to_string()]),
}]),
model_supports_streaming: Some(true),
model_is_active: true,
@@ -1021,7 +1021,7 @@ async fn gateway_returns_concurrency_limited_after_wait_budget_expires_for_opena
StoredProviderCatalogEndpoint::new(
"endpoint-openai-cli-local-timeout-1".to_string(),
"provider-openai-cli-local-timeout-1".to_string(),
"openai:cli".to_string(),
"openai:responses".to_string(),
Some("openai".to_string()),
Some("cli".to_string()),
true,
@@ -1051,7 +1051,7 @@ async fn gateway_returns_concurrency_limited_after_wait_budget_expires_for_opena
)
.expect("key should build")
.with_transport_fields(
Some(serde_json::json!(["openai:cli"])),
Some(serde_json::json!(["openai:responses"])),
encrypt_python_fernet_plaintext(
DEVELOPMENT_ENCRYPTION_KEY,
"sk-upstream-openai-cli-timeout",
@@ -1059,7 +1059,7 @@ async fn gateway_returns_concurrency_limited_after_wait_budget_expires_for_opena
.expect("api key should encrypt"),
None,
None,
Some(serde_json::json!({"openai:cli": 1})),
Some(serde_json::json!({"openai:responses": 1})),
None,
None,
None,
@@ -1112,7 +1112,7 @@ async fn gateway_returns_concurrency_limited_after_wait_budget_expires_for_opena
"route_class": "ai_public",
"route_family": "openai",
"route_kind": "cli",
"auth_endpoint_signature": "openai:cli",
"auth_endpoint_signature": "openai:responses",
"execution_runtime_candidate": true,
"auth_context": {
"user_id": "user-openai-cli-local-timeout-123",
@@ -1272,7 +1272,7 @@ async fn gateway_returns_concurrency_limited_after_wait_budget_expires_for_opena
}
#[tokio::test]
async fn gateway_returns_openai_cli_error_for_local_sync_failure() {
async fn gateway_returns_openai_responses_error_for_local_sync_failure() {
fn hash_api_key(value: &str) -> String {
let mut hasher = Sha256::new();
hasher.update(value.as_bytes());
@@ -1289,7 +1289,7 @@ async fn gateway_returns_openai_cli_error_for_local_sync_failure() {
true,
false,
Some(serde_json::json!(["openai"])),
Some(serde_json::json!(["openai:cli"])),
Some(serde_json::json!(["openai:responses"])),
Some(serde_json::json!(["gpt-5"])),
api_key_id.to_string(),
Some("default".to_string()),
@@ -1300,7 +1300,7 @@ async fn gateway_returns_openai_cli_error_for_local_sync_failure() {
Some(5),
Some(4_102_444_800_i64),
Some(serde_json::json!(["openai"])),
Some(serde_json::json!(["openai:cli"])),
Some(serde_json::json!(["openai:responses"])),
Some(serde_json::json!(["gpt-5"])),
)
.expect("auth snapshot should build")
@@ -1314,7 +1314,7 @@ async fn gateway_returns_openai_cli_error_for_local_sync_failure() {
provider_priority: 10,
provider_is_active: true,
endpoint_id: "endpoint-openai-cli-local-1".to_string(),
endpoint_api_format: "openai:cli".to_string(),
endpoint_api_format: "openai:responses".to_string(),
endpoint_api_family: Some("openai".to_string()),
endpoint_kind: Some("cli".to_string()),
endpoint_is_active: true,
@@ -1322,11 +1322,11 @@ async fn gateway_returns_openai_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!["openai:cli".to_string()]),
key_api_formats: Some(vec!["openai:responses".to_string()]),
key_allowed_models: None,
key_capabilities: None,
key_internal_priority: 5,
key_global_priority_by_format: Some(serde_json::json!({"openai:cli": 1})),
key_global_priority_by_format: Some(serde_json::json!({"openai:responses": 1})),
model_id: "model-openai-cli-local-1".to_string(),
global_model_id: "global-model-openai-cli-local-1".to_string(),
global_model_name: "gpt-5".to_string(),
@@ -1336,7 +1336,7 @@ async fn gateway_returns_openai_cli_error_for_local_sync_failure() {
model_provider_model_mappings: Some(vec![StoredProviderModelMapping {
name: "gpt-5-upstream".to_string(),
priority: 1,
api_formats: Some(vec!["openai:cli".to_string()]),
api_formats: Some(vec!["openai:responses".to_string()]),
}]),
model_supports_streaming: Some(true),
model_is_active: true,
@@ -1369,7 +1369,7 @@ async fn gateway_returns_openai_cli_error_for_local_sync_failure() {
StoredProviderCatalogEndpoint::new(
"endpoint-openai-cli-local-1".to_string(),
"provider-openai-cli-local-1".to_string(),
"openai:cli".to_string(),
"openai:responses".to_string(),
Some("openai".to_string()),
Some("cli".to_string()),
true,
@@ -1405,12 +1405,12 @@ async fn gateway_returns_openai_cli_error_for_local_sync_failure() {
)
.expect("key should build")
.with_transport_fields(
Some(serde_json::json!(["openai:cli"])),
Some(serde_json::json!(["openai:responses"])),
encrypt_python_fernet_plaintext(DEVELOPMENT_ENCRYPTION_KEY, "sk-upstream-openai-cli")
.expect("api key should encrypt"),
None,
None,
Some(serde_json::json!({"openai:cli": 1})),
Some(serde_json::json!({"openai:responses": 1})),
None,
None,
Some(serde_json::json!({"enabled": true, "node_id":"proxy-node-openai-cli-local"})),
@@ -1432,7 +1432,7 @@ async fn gateway_returns_openai_cli_error_for_local_sync_failure() {
"route_class": "ai_public",
"route_family": "openai",
"route_kind": "cli",
"auth_endpoint_signature": "openai:cli",
"auth_endpoint_signature": "openai:responses",
"execution_runtime_candidate": true,
"auth_context": {
"user_id": "user-openai-cli-local-error-123",
@@ -1564,7 +1564,7 @@ async fn gateway_returns_openai_cli_error_for_local_sync_failure() {
}
#[tokio::test]
async fn gateway_returns_openai_cli_error_for_local_cross_format_gemini_sync_failure() {
async fn gateway_returns_openai_responses_error_for_local_cross_format_gemini_sync_failure() {
#[derive(Debug, Clone)]
struct SeenExecutionRuntimeSyncRequest {
trace_id: String,
@@ -1591,7 +1591,7 @@ async fn gateway_returns_openai_cli_error_for_local_cross_format_gemini_sync_fai
true,
false,
Some(serde_json::json!(["openai", "gemini"])),
Some(serde_json::json!(["openai:cli"])),
Some(serde_json::json!(["openai:responses"])),
Some(serde_json::json!(["gpt-5"])),
api_key_id.to_string(),
Some("default".to_string()),
@@ -1602,7 +1602,7 @@ async fn gateway_returns_openai_cli_error_for_local_cross_format_gemini_sync_fai
Some(5),
Some(4_102_444_800_i64),
Some(serde_json::json!(["openai", "gemini"])),
Some(serde_json::json!(["openai:cli"])),
Some(serde_json::json!(["openai:responses"])),
Some(serde_json::json!(["gpt-5"])),
)
.expect("auth snapshot should build")
@@ -1735,7 +1735,7 @@ async fn gateway_returns_openai_cli_error_for_local_cross_format_gemini_sync_fai
"route_class": "ai_public",
"route_family": "openai",
"route_kind": "cli",
"auth_endpoint_signature": "openai:cli",
"auth_endpoint_signature": "openai:responses",
"execution_runtime_candidate": true,
"auth_context": {
"user_id": "user-openai-cli-gemini-local-error-123",
@@ -1940,7 +1940,7 @@ async fn gateway_returns_openai_cli_error_for_local_cross_format_gemini_sync_fai
}
#[tokio::test]
async fn gateway_returns_openai_cli_error_for_local_cross_format_claude_sync_failure() {
async fn gateway_returns_openai_responses_error_for_local_cross_format_claude_sync_failure() {
#[derive(Debug, Clone)]
struct SeenExecutionRuntimeSyncRequest {
trace_id: String,
@@ -1967,7 +1967,7 @@ async fn gateway_returns_openai_cli_error_for_local_cross_format_claude_sync_fai
true,
false,
Some(serde_json::json!(["openai", "claude"])),
Some(serde_json::json!(["openai:cli"])),
Some(serde_json::json!(["openai:responses"])),
Some(serde_json::json!(["gpt-5"])),
api_key_id.to_string(),
Some("default".to_string()),
@@ -1978,7 +1978,7 @@ async fn gateway_returns_openai_cli_error_for_local_cross_format_claude_sync_fai
Some(5),
Some(4_102_444_800_i64),
Some(serde_json::json!(["openai", "claude"])),
Some(serde_json::json!(["openai:cli"])),
Some(serde_json::json!(["openai:responses"])),
Some(serde_json::json!(["gpt-5"])),
)
.expect("auth snapshot should build")
@@ -2111,7 +2111,7 @@ async fn gateway_returns_openai_cli_error_for_local_cross_format_claude_sync_fai
"route_class": "ai_public",
"route_family": "openai",
"route_kind": "cli",
"auth_endpoint_signature": "openai:cli",
"auth_endpoint_signature": "openai:responses",
"execution_runtime_candidate": true,
"auth_context": {
"user_id": "user-openai-cli-claude-local-error-123",
@@ -2316,7 +2316,7 @@ async fn gateway_returns_openai_cli_error_for_local_cross_format_claude_sync_fai
}
#[tokio::test]
async fn gateway_returns_openai_cli_error_for_local_cross_format_claude_chat_sync_failure() {
async fn gateway_returns_openai_responses_error_for_local_cross_format_claude_chat_sync_failure() {
#[derive(Debug, Clone)]
struct SeenExecutionRuntimeSyncRequest {
trace_id: String,
@@ -2343,7 +2343,7 @@ async fn gateway_returns_openai_cli_error_for_local_cross_format_claude_chat_syn
true,
false,
Some(serde_json::json!(["openai", "claude"])),
Some(serde_json::json!(["openai:cli"])),
Some(serde_json::json!(["openai:responses"])),
Some(serde_json::json!(["gpt-5"])),
api_key_id.to_string(),
Some("default".to_string()),
@@ -2354,7 +2354,7 @@ async fn gateway_returns_openai_cli_error_for_local_cross_format_claude_chat_syn
Some(5),
Some(4_102_444_800_i64),
Some(serde_json::json!(["openai", "claude"])),
Some(serde_json::json!(["openai:cli"])),
Some(serde_json::json!(["openai:responses"])),
Some(serde_json::json!(["gpt-5"])),
)
.expect("auth snapshot should build")
@@ -2487,7 +2487,7 @@ async fn gateway_returns_openai_cli_error_for_local_cross_format_claude_chat_syn
"route_class": "ai_public",
"route_family": "openai",
"route_kind": "cli",
"auth_endpoint_signature": "openai:cli",
"auth_endpoint_signature": "openai:responses",
"execution_runtime_candidate": true,
"auth_context": {
"user_id": "user-openai-cli-claude-chat-local-error-123",
@@ -2695,7 +2695,7 @@ async fn gateway_returns_openai_cli_error_for_local_cross_format_claude_chat_syn
}
#[tokio::test]
async fn gateway_returns_openai_cli_error_for_local_cross_format_gemini_chat_sync_failure() {
async fn gateway_returns_openai_responses_error_for_local_cross_format_gemini_chat_sync_failure() {
#[derive(Debug, Clone)]
struct SeenExecutionRuntimeSyncRequest {
trace_id: String,
@@ -2722,7 +2722,7 @@ async fn gateway_returns_openai_cli_error_for_local_cross_format_gemini_chat_syn
true,
false,
Some(serde_json::json!(["openai", "gemini"])),
Some(serde_json::json!(["openai:cli"])),
Some(serde_json::json!(["openai:responses"])),
Some(serde_json::json!(["gpt-5"])),
api_key_id.to_string(),
Some("default".to_string()),
@@ -2733,7 +2733,7 @@ async fn gateway_returns_openai_cli_error_for_local_cross_format_gemini_chat_syn
Some(5),
Some(4_102_444_800_i64),
Some(serde_json::json!(["openai", "gemini"])),
Some(serde_json::json!(["openai:cli"])),
Some(serde_json::json!(["openai:responses"])),
Some(serde_json::json!(["gpt-5"])),
)
.expect("auth snapshot should build")
@@ -2866,7 +2866,7 @@ async fn gateway_returns_openai_cli_error_for_local_cross_format_gemini_chat_syn
"route_class": "ai_public",
"route_family": "openai",
"route_kind": "cli",
"auth_endpoint_signature": "openai:cli",
"auth_endpoint_signature": "openai:responses",
"execution_runtime_candidate": true,
"auth_context": {
"user_id": "user-openai-cli-gemini-chat-local-error-123",
@@ -3108,7 +3108,7 @@ async fn gateway_executes_codex_cli_sync_via_local_decision_gate_after_oauth_ref
true,
false,
Some(serde_json::json!(["openai", "codex"])),
Some(serde_json::json!(["openai:cli"])),
Some(serde_json::json!(["openai:responses"])),
Some(serde_json::json!(["gpt-5.4"])),
api_key_id.to_string(),
Some("default".to_string()),
@@ -3119,7 +3119,7 @@ async fn gateway_executes_codex_cli_sync_via_local_decision_gate_after_oauth_ref
Some(5),
Some(4_102_444_800_i64),
Some(serde_json::json!(["openai", "codex"])),
Some(serde_json::json!(["openai:cli"])),
Some(serde_json::json!(["openai:responses"])),
Some(serde_json::json!(["gpt-5.4"])),
)
.expect("auth snapshot should build")
@@ -3133,7 +3133,7 @@ async fn gateway_executes_codex_cli_sync_via_local_decision_gate_after_oauth_ref
provider_priority: 10,
provider_is_active: true,
endpoint_id: "endpoint-codex-cli-local-1".to_string(),
endpoint_api_format: "openai:cli".to_string(),
endpoint_api_format: "openai:responses".to_string(),
endpoint_api_family: Some("openai".to_string()),
endpoint_kind: Some("cli".to_string()),
endpoint_is_active: true,
@@ -3141,11 +3141,11 @@ async fn gateway_executes_codex_cli_sync_via_local_decision_gate_after_oauth_ref
key_name: "oauth".to_string(),
key_auth_type: "oauth".to_string(),
key_is_active: true,
key_api_formats: Some(vec!["openai:cli".to_string()]),
key_api_formats: Some(vec!["openai:responses".to_string()]),
key_allowed_models: None,
key_capabilities: None,
key_internal_priority: 5,
key_global_priority_by_format: Some(serde_json::json!({"openai:cli": 1})),
key_global_priority_by_format: Some(serde_json::json!({"openai:responses": 1})),
model_id: "model-codex-cli-local-1".to_string(),
global_model_id: "global-model-codex-cli-local-1".to_string(),
global_model_name: "gpt-5.4".to_string(),
@@ -3155,7 +3155,7 @@ async fn gateway_executes_codex_cli_sync_via_local_decision_gate_after_oauth_ref
model_provider_model_mappings: Some(vec![StoredProviderModelMapping {
name: "gpt-5.4".to_string(),
priority: 1,
api_formats: Some(vec!["openai:cli".to_string()]),
api_formats: Some(vec!["openai:responses".to_string()]),
}]),
model_supports_streaming: Some(true),
model_is_active: true,
@@ -3188,7 +3188,7 @@ async fn gateway_executes_codex_cli_sync_via_local_decision_gate_after_oauth_ref
StoredProviderCatalogEndpoint::new(
"endpoint-codex-cli-local-1".to_string(),
"provider-codex-cli-local-1".to_string(),
"openai:cli".to_string(),
"openai:responses".to_string(),
Some("openai".to_string()),
Some("cli".to_string()),
true,
@@ -3223,12 +3223,12 @@ async fn gateway_executes_codex_cli_sync_via_local_decision_gate_after_oauth_ref
)
.expect("key should build")
.with_transport_fields(
Some(serde_json::json!(["openai:cli"])),
Some(serde_json::json!(["openai:responses"])),
encrypt_python_fernet_plaintext(DEVELOPMENT_ENCRYPTION_KEY, "__placeholder__")
.expect("placeholder api key should encrypt"),
Some(encrypted_auth_config),
None,
Some(serde_json::json!({"openai:cli": 1})),
Some(serde_json::json!({"openai:responses": 1})),
None,
None,
None,