This commit is contained in:
Ahmed Ibrahim
2026-01-05 10:10:32 -08:00
parent 88d090a2b7
commit d7b0997d32
4 changed files with 26 additions and 22 deletions
+7 -4
View File
@@ -181,6 +181,10 @@ impl App {
let (app_event_tx, mut app_event_rx) = unbounded_channel();
let app_event_tx = AppEventSender::new(app_event_tx);
let mut config = config;
let pending_model_migration_notice =
crate::model_migration::take_pending_model_migration_notice(&mut config);
let conversation_manager = Arc::new(ConversationManager::new(
auth_manager.clone(),
SessionSource::Cli,
@@ -238,10 +242,9 @@ impl App {
}
};
// Startup-only: show any previously scheduled model migration notice, then refresh the
// schedule to reflect the current config + model presets (at most one scheduled notice).
chat_widget.maybe_show_pending_model_migration_notice();
chat_widget.refresh_pending_model_migration_notice();
if let Some(notice) = pending_model_migration_notice {
chat_widget.show_model_migration_notice(notice);
}
chat_widget.maybe_prompt_windows_sandbox_enable();
+6 -7
View File
@@ -469,6 +469,7 @@ impl ChatWidget {
// turn now that we know the session is configured.
self.maybe_send_next_queued_input();
}
self.refresh_pending_model_migration_notice();
if !self.suppress_session_configured_redraw {
self.request_redraw();
}
@@ -806,12 +807,10 @@ impl ChatWidget {
self.request_redraw();
}
pub(crate) fn maybe_show_pending_model_migration_notice(&mut self) {
let Some(notice) = model_migration::take_pending_model_migration_notice(&mut self.config)
else {
return;
};
pub(crate) fn show_model_migration_notice(
&mut self,
notice: model_migration::PendingModelMigrationNotice,
) {
self.add_to_history(history_cell::new_info_event(
format!(
"Model upgrade available: {} -> {}. Use /model to switch.",
@@ -826,7 +825,7 @@ impl ChatWidget {
});
}
pub(crate) fn refresh_pending_model_migration_notice(&self) {
fn refresh_pending_model_migration_notice(&self) {
let available_models = match self.models_manager.try_list_models(&self.config) {
Ok(models) => models,
Err(_) => return,
+7 -4
View File
@@ -222,6 +222,10 @@ impl App {
let (app_event_tx, mut app_event_rx) = unbounded_channel();
let app_event_tx = AppEventSender::new(app_event_tx);
let mut config = config;
let pending_model_migration_notice =
crate::model_migration::take_pending_model_migration_notice(&mut config);
let conversation_manager = Arc::new(ConversationManager::new(
auth_manager.clone(),
SessionSource::Cli,
@@ -279,10 +283,9 @@ impl App {
}
};
// Startup-only: show any previously scheduled model migration notice, then refresh the
// schedule to reflect the current config + model presets (at most one scheduled notice).
chat_widget.maybe_show_pending_model_migration_notice();
chat_widget.refresh_pending_model_migration_notice();
if let Some(notice) = pending_model_migration_notice {
chat_widget.show_model_migration_notice(notice);
}
chat_widget.maybe_prompt_windows_sandbox_enable();
+6 -7
View File
@@ -434,6 +434,7 @@ impl ChatWidget {
// turn now that we know the session is configured.
self.maybe_send_next_queued_input();
}
self.refresh_pending_model_migration_notice();
if !self.suppress_session_configured_redraw {
self.request_redraw();
}
@@ -748,12 +749,10 @@ impl ChatWidget {
self.request_redraw();
}
pub(crate) fn maybe_show_pending_model_migration_notice(&mut self) {
let Some(notice) = model_migration::take_pending_model_migration_notice(&mut self.config)
else {
return;
};
pub(crate) fn show_model_migration_notice(
&mut self,
notice: model_migration::PendingModelMigrationNotice,
) {
self.add_to_history(history_cell::new_info_event(
format!(
"Model upgrade available: {} -> {}. Use /model to switch.",
@@ -768,7 +767,7 @@ impl ChatWidget {
});
}
pub(crate) fn refresh_pending_model_migration_notice(&self) {
fn refresh_pending_model_migration_notice(&self) {
let available_models = match self.models_manager.try_list_models(&self.config) {
Ok(models) => models,
Err(_) => return,