From 1bcd2a75895f129b6f8dc525e17d08f5a3fae0d5 Mon Sep 17 00:00:00 2001 From: Daniel Edrisian Date: Thu, 2 Oct 2025 20:25:08 -0700 Subject: [PATCH] Move gpt-5-codex to top --- codex-rs/tui/src/chatwidget.rs | 10 +++++++--- ..._tui__chatwidget__tests__model_selection_popup.snap | 4 ++-- 2 files changed, 9 insertions(+), 5 deletions(-) diff --git a/codex-rs/tui/src/chatwidget.rs b/codex-rs/tui/src/chatwidget.rs index 38510c5c47..48c23f868c 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 cfe99bd0a6..60c886820c 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