mirror of
https://github.com/openai/codex.git
synced 2026-10-28 16:06:15 +00:00
Allow injecting the models manager into ThreadManager (#32911)
## Why Embedding callers need to control whether model catalogs are persisted to disk. ## What changed - Accept a shared models manager when constructing `ThreadManager` instead of always creating a cached manager internally. - Add provider APIs for creating uncached model managers. OpenAI-compatible providers fetch on each `OnlineIfUncached` refresh without reading or writing `models_cache.json`. - Keep existing app server, MCP server, sample, and test callers on the standard cached manager. ## Testing - Verify an uncached manager fetches on every refresh. - Verify an injected uncached manager controls thread refresh behavior and does not create `models_cache.json`. GitOrigin-RevId: 8bb646054ecec4ccb865b2bf56249384916ea9db
This commit is contained in:
@@ -2393,9 +2393,11 @@ async fn spawn_thread_subagent_uses_role_specific_nickname_candidates() {
|
||||
async fn resume_thread_subagent_restores_stored_metadata() {
|
||||
let (home, config) = test_config().await;
|
||||
let thread_store = Arc::new(InMemoryThreadStore::default());
|
||||
let auth_manager = AuthManager::from_auth_for_testing(CodexAuth::from_api_key("dummy"));
|
||||
let manager = ThreadManager::new(
|
||||
&config,
|
||||
AuthManager::from_auth_for_testing(CodexAuth::from_api_key("dummy")),
|
||||
auth_manager.clone(),
|
||||
crate::thread_manager::build_models_manager(&config, auth_manager),
|
||||
SessionSource::Exec,
|
||||
Arc::new(codex_exec_server::EnvironmentManager::default_for_tests()),
|
||||
empty_extension_registry(),
|
||||
|
||||
Reference in New Issue
Block a user