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

@@ -302,7 +302,10 @@ impl App {
};
let enhanced_keys_supported = tui.enhanced_keys_supported();
let model_family = conversation_manager
.get_models_manager()
.construct_model_family(&config.model, &config)
.await;
let mut chat_widget = match resume_selection {
ResumeSelection::StartFresh | ResumeSelection::Exit => {
let init = crate::chatwidget::ChatWidgetInit {
@@ -317,6 +320,7 @@ impl App {
feedback: feedback.clone(),
skills: skills.clone(),
is_first_run,
model_family,
};
ChatWidget::new(init, conversation_manager.clone())
}
@@ -343,6 +347,7 @@ impl App {
feedback: feedback.clone(),
skills: skills.clone(),
is_first_run,
model_family,
};
ChatWidget::new_from_existing(
init,
@@ -481,6 +486,11 @@ impl App {
}
async fn handle_event(&mut self, tui: &mut tui::Tui, event: AppEvent) -> Result<bool> {
let model_family = self
.server
.get_models_manager()
.construct_model_family(&self.config.model, &self.config)
.await;
match event {
AppEvent::NewSession => {
let summary = session_summary(
@@ -500,6 +510,7 @@ impl App {
feedback: self.feedback.clone(),
skills: self.skills.clone(),
is_first_run: false,
model_family,
};
self.chat_widget = ChatWidget::new(init, self.server.clone());
if let Some(summary) = summary {
@@ -549,6 +560,7 @@ impl App {
feedback: self.feedback.clone(),
skills: self.skills.clone(),
is_first_run: false,
model_family: model_family.clone(),
};
self.chat_widget = ChatWidget::new_from_existing(
init,
@@ -677,7 +689,12 @@ impl App {
self.on_update_reasoning_effort(effort);
}
AppEvent::UpdateModel(model) => {
self.chat_widget.set_model(&model);
let model_family = self
.server
.get_models_manager()
.construct_model_family(&model, &self.config)
.await;
self.chat_widget.set_model(&model, model_family);
self.config.model = model;
}
AppEvent::OpenReasoningPopup { model } => {