Wire with_remote_overrides to construct model families (#7621)

- This PR wires `with_remote_overrides` and make the
`construct_model_families` an async function
- Moves getting model family a level above to keep the function `sync`
- Updates the tests to local, offline, and `sync` helper for model
families
This commit is contained in:
Ahmed Ibrahim
2025-12-05 10:40:15 -08:00
committed by GitHub
parent 5f80ad6da8
commit d08efb1743
16 changed files with 147 additions and 108 deletions

View File

@@ -10,6 +10,7 @@ use codex_core::CodexAuth;
use codex_core::config::Config;
use codex_core::config::ConfigOverrides;
use codex_core::config::ConfigToml;
use codex_core::openai_models::models_manager::ModelsManager;
use codex_core::protocol::AgentMessageDeltaEvent;
use codex_core::protocol::AgentMessageEvent;
use codex_core::protocol::AgentReasoningDeltaEvent;
@@ -345,6 +346,7 @@ async fn helpers_are_available_and_do_not_panic() {
let (tx_raw, _rx) = unbounded_channel::<AppEvent>();
let tx = AppEventSender::new(tx_raw);
let cfg = test_config();
let model_family = ModelsManager::construct_model_family_offline(&cfg.model, &cfg);
let conversation_manager = Arc::new(ConversationManager::with_auth(CodexAuth::from_api_key(
"test",
)));
@@ -361,6 +363,7 @@ async fn helpers_are_available_and_do_not_panic() {
feedback: codex_feedback::CodexFeedback::new(),
skills: None,
is_first_run: true,
model_family,
};
let mut w = ChatWidget::new(init, conversation_manager);
// Basic construction sanity.
@@ -394,6 +397,7 @@ fn make_chatwidget_manual() -> (
bottom_pane: bottom,
active_cell: None,
config: cfg.clone(),
model_family: ModelsManager::construct_model_family_offline(&cfg.model, &cfg),
auth_manager: auth_manager.clone(),
models_manager: Arc::new(ModelsManager::new(auth_manager)),
session_header: SessionHeader::new(cfg.model),