mirror of
https://github.com/openai/codex.git
synced 2026-11-18 23:02:23 +00:00
Refresh the TUI model picker from the app server (#41467)
## Why The model picker can open from a cached startup catalog that no longer reflects the models available to the current account. ## What changed - Fetch the current model list asynchronously whenever the picker opens, while showing cached choices immediately. - Refresh an open model picker in place, preserving its highlighted model, dismissal behavior, and reasoning submenu. - Apply accepted catalog updates to model-dependent UI, service-tier controls, and new-thread defaults. Ignore stale, failed, empty, unchanged, or account-invalidated responses. ## Testing - Added coverage for catalog refreshes, stale and unusable responses, popup state preservation, empty choices, service tiers, and new-thread defaults. GitOrigin-RevId: 45abe1d309ff7f90701fffe29c6544ca4157f836
This commit is contained in:
1 parent
0b45b171ca
commit
5fc7840cf6
16 files changed
+609
-18
No files matched your search
@@ -1518,6 +1518,18 @@ impl App {
|
||||
}
|
||||
}
|
||||
}
|
||||
AppEvent::FetchModels { request_id } => {
|
||||
if self.chat_widget.model_popup_request_is_current(request_id) {
|
||||
app_server.fetch_models(request_id, self.app_event_tx.clone());
|
||||
}
|
||||
}
|
||||
AppEvent::ModelsLoaded { request_id, result } => {
|
||||
if self.chat_widget.on_models_loaded(request_id, result) {
|
||||
self.model_catalog = self.chat_widget.model_catalog();
|
||||
app_server.set_available_models(self.model_catalog.try_list_models()?);
|
||||
self.sync_active_thread_service_tier_to_cached_session().await;
|
||||
}
|
||||
}
|
||||
AppEvent::OpenReasoningPopup { model } => {
|
||||
self.chat_widget.open_reasoning_popup(model);
|
||||
}
|
||||
@@ -1571,8 +1583,8 @@ impl App {
|
||||
self.chat_widget
|
||||
.open_plan_reasoning_scope_prompt(model, effort);
|
||||
}
|
||||
AppEvent::OpenAllModelsPopup { models } => {
|
||||
self.chat_widget.open_all_models_popup(models);
|
||||
AppEvent::OpenAllModelsPopup => {
|
||||
self.chat_widget.open_all_models_popup();
|
||||
}
|
||||
AppEvent::OpenFullAccessConfirmation {
|
||||
preset,
|
||||
|
||||
Reference in new issue
Block a user