Skip to content

armgit / codex

Public Imported from GitHub
0

Lightweight coding agent that runs in your terminal

Rust

Move gpt-5-codex to top (#4641)

dedrisian-oai231c36f8d39e
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<ModelPreset> = builtin_model_presets(auth_mode);
- let mut grouped: BTreeMap<&str, Vec<ModelPreset>> = BTreeMap::new();
+ let mut grouped: Vec<(&str, Vec<ModelPreset>)> = 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<SelectionItem> = 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