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

@@ -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!(