Call models endpoint in models manager (#7616)

- Introduce `with_remote_overrides` and update
`refresh_available_models`
- Put `auth_manager` instead of `auth_mode` on `models_manager`
- Remove `ShellType` and `ReasoningLevel` to use already existing
structs
This commit is contained in:
Ahmed Ibrahim
2025-12-04 18:28:03 -08:00
committed by GitHub
parent 6736d1828d
commit 7b359c9c8e
13 changed files with 329 additions and 88 deletions

View File

@@ -1,6 +1,8 @@
use std::sync::Arc;
use codex_app_server_protocol::AuthMode;
use codex_core::AuthManager;
use codex_core::CodexAuth;
use codex_core::ContentItem;
use codex_core::LocalShellAction;
use codex_core::LocalShellExecAction;
@@ -71,7 +73,8 @@ async fn run_request(input: Vec<ResponseItem>) -> Value {
let config = Arc::new(config);
let conversation_id = ConversationId::new();
let models_manager = Arc::new(ModelsManager::new(Some(AuthMode::ApiKey)));
let auth_manager = AuthManager::from_auth_for_testing(CodexAuth::from_api_key("Test API Key"));
let models_manager = Arc::new(ModelsManager::new(auth_manager));
let model_family = models_manager.construct_model_family(&config.model, &config);
let otel_event_manager = OtelEventManager::new(
conversation_id,