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

@@ -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,