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:
andrea.difonzo
2026-11-10 16:07:22 +01:00
parent 231e8cd136
commit 5afc7e9f7f
1223 changed files with 6225 additions and 113722 deletions

View File

@@ -28,7 +28,6 @@ fn preset_to_info(preset: &ModelPreset, priority: i32) -> ModelInfo {
additional_speed_tiers: preset.additional_speed_tiers.clone(),
service_tiers: preset.service_tiers.clone(),
default_service_tier: preset.default_service_tier.clone(),
available_access_programs: preset.available_access_programs.clone(),
upgrade: preset.upgrade.as_ref().map(Into::into),
model_messages: Some(ModelMessages {
apps: None,
@@ -131,3 +130,24 @@ pub async fn write_models_cache_with_models(
let cache_path = codex_home.join("models_cache.json");
std::fs::write(cache_path, serde_json::to_string_pretty(&cache)?)
}
/// Write `models` as a `model_catalog_json` catalog and point `config.toml` at it.
///
/// API-key sessions without a provider model catalog URL never read `models_cache.json`, so
/// tests that pair specific model metadata with API-key auth configure the catalog directly.
pub fn write_model_catalog_json(codex_home: &Path, models: Vec<ModelInfo>) -> std::io::Result<()> {
let catalog_path = codex_home.join("models.json");
std::fs::write(
&catalog_path,
serde_json::to_string_pretty(&serde_json::json!({ "models": models }))?,
)?;
let config_path = codex_home.join("config.toml");
let config = std::fs::read_to_string(&config_path)?;
std::fs::write(
&config_path,
format!(
"model_catalog_json = {}\n{config}",
serde_json::to_string(&catalog_path)?
),
)
}