diff --git a/codex-rs/tui/src/chatwidget.rs b/codex-rs/tui/src/chatwidget.rs index 38510c5c..48c23f86 100644 --- a/codex-rs/tui/src/chatwidget.rs +++ b/codex-rs/tui/src/chatwidget.rs @@ -1,4 +1,3 @@ -use std::collections::BTreeMap; use std::collections::HashMap; use std::collections::VecDeque; use std::path::PathBuf; @@ -1598,9 +1597,14 @@ impl ChatWidget { let auth_mode = self.auth_manager.auth().map(|auth| auth.mode); let presets: Vec = builtin_model_presets(auth_mode); - let mut grouped: BTreeMap<&str, Vec> = BTreeMap::new(); + let mut grouped: Vec<(&str, Vec)> = Vec::new(); for preset in presets.into_iter() { - grouped.entry(preset.model).or_default().push(preset); + if let Some((_, entries)) = grouped.iter_mut().find(|(model, _)| *model == preset.model) + { + entries.push(preset); + } else { + grouped.push((preset.model, vec![preset])); + } } let mut items: Vec = Vec::new(); diff --git a/codex-rs/tui/src/chatwidget/snapshots/codex_tui__chatwidget__tests__model_selection_popup.snap b/codex-rs/tui/src/chatwidget/snapshots/codex_tui__chatwidget__tests__model_selection_popup.snap index cfe99bd0..60c88682 100644 --- a/codex-rs/tui/src/chatwidget/snapshots/codex_tui__chatwidget__tests__model_selection_popup.snap +++ b/codex-rs/tui/src/chatwidget/snapshots/codex_tui__chatwidget__tests__model_selection_popup.snap @@ -5,8 +5,8 @@ expression: popup Select Model Switch the model for this and future Codex CLI sessions - 1. gpt-5 Broad world knowledge with strong general +› 1. gpt-5-codex (current) Optimized for coding tasks with many tools. + 2. gpt-5 Broad world knowledge with strong general reasoning. -› 2. gpt-5-codex (current) Optimized for coding tasks with many tools. Press enter to confirm or esc to go back