diff --git a/apps/aether-gateway/src/model_fetch/catalog.rs b/apps/aether-gateway/src/model_fetch/catalog.rs index 65e274e6f..8d19a3750 100644 --- a/apps/aether-gateway/src/model_fetch/catalog.rs +++ b/apps/aether-gateway/src/model_fetch/catalog.rs @@ -2663,14 +2663,11 @@ mod tests { assert_eq!(plans.len(), 2); assert!(plans[0].url.ends_with("/models?client_version=0.145.2")); assert!(plans[1].url.ends_with("/models?client_version=0.146.0")); - assert_eq!( - plans[0].headers.get("user-agent").map(String::as_str), - Some("codex_cli_rs/0.145.2") - ); - assert_eq!( - plans[1].headers.get("user-agent").map(String::as_str), - Some("codex_cli_rs/0.146.0") - ); + for (plan, version) in plans.iter().zip(["0.145.2", "0.146.0"]) { + let ua = plan.headers.get("user-agent").expect("画像应包含 UA"); + assert!(ua.starts_with(&format!("codex_cli_rs/{version} ("))); + assert!(ua.ends_with(") unknown")); + } let target = target(); assert_ne!( diff --git a/apps/aether-gateway/src/tests/control/admin/provider_query.rs b/apps/aether-gateway/src/tests/control/admin/provider_query.rs index 336063114..d44d64592 100644 --- a/apps/aether-gateway/src/tests/control/admin/provider_query.rs +++ b/apps/aether-gateway/src/tests/control/admin/provider_query.rs @@ -849,6 +849,12 @@ async fn gateway_handles_admin_provider_query_models_falls_back_to_codex_preset_ "gpt-5.6-luna", "gpt-5.6-sol", "gpt-5.6-terra", + "gpt-6-astra", + "gpt-6-luna", + "gpt-6-sol", + "gpt-6.1-sol", + "gpt-daybreak-blue-latest", + "gpt-daybreak-red-latest", ] ); assert_eq!( diff --git a/apps/aether-gateway/src/tests/frontdoor/ai.rs b/apps/aether-gateway/src/tests/frontdoor/ai.rs index 1ba25afc6..06157a44e 100644 --- a/apps/aether-gateway/src/tests/frontdoor/ai.rs +++ b/apps/aether-gateway/src/tests/frontdoor/ai.rs @@ -1270,10 +1270,9 @@ async fn run_versioned_codex_model_cards_frontdoor_scenario() { captured_catalog_plan.0, "https://chatgpt.example/backend-api/codex/models?client_version=0.145.2" ); - assert_eq!( - captured_catalog_plan.1.as_deref(), - Some("codex_cli_rs/0.145.2") - ); + let captured_ua = captured_catalog_plan.1.expect("目录请求应包含 UA"); + assert!(captured_ua.starts_with("codex_cli_rs/0.145.2 (")); + assert!(captured_ua.ends_with(") unknown")); let fresh_response = client .get(format!("{gateway_url}/v1/models?client_version=0.145.2")) diff --git a/docs/operations/codex-cli-alignment.md b/docs/operations/codex-cli-alignment.md index d707c90f6..714926f05 100644 --- a/docs/operations/codex-cli-alignment.md +++ b/docs/operations/codex-cli-alignment.md @@ -26,8 +26,10 @@ Apps 文件上传属于 CLI 的 ChatGPT Apps 专用路径,普通自定义 API ```bash cargo fmt --all -- --check -cargo test --locked -p aether-ai-formats -p aether-oauth -p aether-model-fetch -p aether-provider-transport -p aether-usage-runtime --lib -cargo test --locked -p aether-gateway --lib +RUST_MIN_STACK=16777216 cargo test --locked -p aether-ai-formats -p aether-oauth -p aether-model-fetch -p aether-provider-transport -p aether-usage-runtime --lib -- --test-threads=1 +RUST_MIN_STACK=16777216 cargo test --locked -p aether-gateway --lib -- --test-threads=1 ``` +完整网关测试需要可执行的临时 PostgreSQL 工具(`AETHER_INITDB_BIN`、`AETHER_POSTGRES_BIN`、`AETHER_PG_CTL_BIN`)、权限受控的临时目录,以及不允许组写入的测试运行目录。Unix socket、更新元数据与私有运行文件测试会主动拒绝不安全的路径;测试目录应以 `umask 022` 或更严格的权限创建。 + 原生记忆端到端测试覆盖真实网关的权限、候选调度、执行计划、模型指令、原生 JSON、成功候选状态与明确停止重试策略下的上游错误响应;执行端使用本地测试服务器,实际账户网络可用性须在部署现场单独验证。