From 911b2bf45b2a03ce6349c5094bb991d2ad82e79f Mon Sep 17 00:00:00 2001 From: Sayan Sisodiya Date: Mon, 23 Feb 2026 15:03:52 -0800 Subject: [PATCH] integration test --- codex-rs/core/tests/suite/remote_models.rs | 33 ++++++++++++++++++++++ 1 file changed, 33 insertions(+) diff --git a/codex-rs/core/tests/suite/remote_models.rs b/codex-rs/core/tests/suite/remote_models.rs index f4d0d1b843..3d2c421146 100644 --- a/codex-rs/core/tests/suite/remote_models.rs +++ b/codex-rs/core/tests/suite/remote_models.rs @@ -608,6 +608,39 @@ async fn remote_models_preserve_builtin_presets() -> Result<()> { Ok(()) } +#[tokio::test(flavor = "multi_thread", worker_threads = 2)] +async fn custom_catalog_models_omit_builtin_presets_in_listing() -> Result<()> { + let codex_home = TempDir::new()?; + let auth = CodexAuth::from_api_key("Test API Key"); + let auth_manager = codex_core::test_support::auth_manager_from_auth(auth); + let manager = ModelsManager::new( + codex_home.path().to_path_buf(), + auth_manager, + Some(ModelsResponse { + models: vec![test_remote_model( + "oca/gpt-5.2-codex", + ModelVisibility::List, + 0, + )], + }), + ); + + let available = manager.list_models(RefreshStrategy::Offline).await; + + assert!( + available + .iter() + .any(|model| model.model == "oca/gpt-5.2-codex"), + "custom catalog model should be listed" + ); + assert!( + !available.iter().any(|model| model.model == "gpt-5.2-codex"), + "builtin presets should be omitted when custom catalog is provided" + ); + + Ok(()) +} + #[tokio::test(flavor = "multi_thread", worker_threads = 2)] async fn remote_models_merge_adds_new_high_priority_first() -> Result<()> { skip_if_no_network!(Ok(()));