WIP fase 2b-3: rimozione sottosistemi solo-ChatGPT (plugin remoti, image gen, daybreak, cyber, attestation, cloud config, app/connettori) - test in corso
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
@@ -3,7 +3,6 @@ use std::time::Duration;
|
||||
use anyhow::Error;
|
||||
use anyhow::Result;
|
||||
use app_test_support::TestAppServer;
|
||||
use app_test_support::write_api_key_auth;
|
||||
use app_test_support::write_models_cache;
|
||||
use codex_app_server_protocol::ClientRequest;
|
||||
use codex_app_server_protocol::ExperimentalFeatureEnablementSetParams;
|
||||
@@ -19,7 +18,6 @@ use codex_app_server_protocol::RequestId;
|
||||
use codex_config::types::AuthCredentialsStoreMode;
|
||||
use codex_login::AuthKeyringBackendKind;
|
||||
use codex_login::login_with_api_key;
|
||||
use codex_protocol::openai_models::MODEL_SPECIALTY_CYBER;
|
||||
use codex_protocol::openai_models::ModelInfo;
|
||||
use codex_protocol::openai_models::ModelPreset;
|
||||
use codex_protocol::openai_models::ModelsResponse;
|
||||
@@ -233,7 +231,6 @@ fn model_from_preset(preset: &ModelPreset) -> Model {
|
||||
})
|
||||
.collect(),
|
||||
default_service_tier: preset.default_service_tier.clone(),
|
||||
available_access_programs: preset.available_access_programs.clone().map(Into::into),
|
||||
is_default: preset.is_default,
|
||||
}
|
||||
}
|
||||
@@ -315,13 +312,10 @@ async fn list_models_includes_hidden_models() -> Result<()> {
|
||||
Ok(())
|
||||
}
|
||||
|
||||
#[test_case("chatgpt-access-token", None; "chatgpt")]
|
||||
#[test_case("test-api-key", Some("test-api-key"); "api key")]
|
||||
#[test_case("test-api-key"; "api key")]
|
||||
#[tokio::test]
|
||||
async fn list_models_uses_remote_catalog_as_source_of_truth(
|
||||
bearer_token: &str,
|
||||
api_key: Option<&str>,
|
||||
) -> Result<()> {
|
||||
async fn list_models_uses_remote_catalog_as_source_of_truth(api_key: &str) -> Result<()> {
|
||||
let bearer_token = api_key;
|
||||
let server = MockServer::start().await;
|
||||
let remote_models = [
|
||||
(
|
||||
@@ -339,7 +333,7 @@ async fn list_models_uses_remote_catalog_as_source_of_truth(
|
||||
"slug": format!("remote-only-{priority}"),
|
||||
"display_name": "Remote Only",
|
||||
"description": "Remote-only model for app-server model/list coverage",
|
||||
"model_specialty": MODEL_SPECIALTY_CYBER,
|
||||
// Legacy catalog metadata must still be accepted and ignored.
|
||||
"available_access_programs": access_programs,
|
||||
"default_reasoning_level": "max",
|
||||
"supported_reasoning_levels": [
|
||||
@@ -402,16 +396,12 @@ model_catalog_url = "{server_uri}/v1/models"
|
||||
"#
|
||||
),
|
||||
)?;
|
||||
if let Some(api_key) = api_key {
|
||||
login_with_api_key(
|
||||
codex_home.path(),
|
||||
api_key,
|
||||
AuthCredentialsStoreMode::File,
|
||||
AuthKeyringBackendKind::default(),
|
||||
)?;
|
||||
} else {
|
||||
write_api_key_auth(codex_home.path())?;
|
||||
}
|
||||
login_with_api_key(
|
||||
codex_home.path(),
|
||||
api_key,
|
||||
AuthCredentialsStoreMode::File,
|
||||
AuthKeyringBackendKind::default(),
|
||||
)?;
|
||||
|
||||
let mut mcp = TestAppServer::builder()
|
||||
.with_codex_home(codex_home.path())
|
||||
@@ -443,14 +433,9 @@ model_catalog_url = "{server_uri}/v1/models"
|
||||
.as_array()
|
||||
.expect("model/list data should be an array")
|
||||
.iter()
|
||||
.map(|model| model["availableAccessPrograms"].clone())
|
||||
.map(|model| model.get("availableAccessPrograms").cloned())
|
||||
.collect::<Vec<_>>(),
|
||||
vec![
|
||||
json!({ "cyber": ["standard", "daybreakBlue"] }),
|
||||
json!({ "cyber": ["daybreakRed"] }),
|
||||
json!({ "cyber": [] }),
|
||||
json!(null),
|
||||
]
|
||||
vec![None; 4]
|
||||
);
|
||||
let ModelListResponse {
|
||||
data: items,
|
||||
|
||||
Reference in New Issue
Block a user