Lightweight coding agent that runs in your terminal
Rust
copy for model migration nudge (#6585)
Ahmed Ibrahim305fe73d83cd
diff --git a/codex-rs/tui/src/app.rs b/codex-rs/tui/src/app.rsindex 7209765614..42967a7c55 100644--- a/codex-rs/tui/src/app.rs+++ b/codex-rs/tui/src/app.rs@@ -84,7 +84,7 @@ async fn handle_model_migration_prompt_if_needed(return None;}- match run_model_migration_prompt(tui, &target_model).await {+ match run_model_migration_prompt(tui).await {ModelMigrationOutcome::Accepted => {app_event_tx.send(AppEvent::PersistModelMigrationPromptAcknowledged {migration_config: "hide_gpt5_1_migration_prompt".to_string(),diff --git a/codex-rs/tui/src/chatwidget.rs b/codex-rs/tui/src/chatwidget.rsindex a92b28db69..ac0995caaf 100644--- a/codex-rs/tui/src/chatwidget.rs+++ b/codex-rs/tui/src/chatwidget.rs@@ -1856,7 +1856,7 @@ impl ChatWidget {self.bottom_pane.show_selection_view(SelectionViewParams {title: Some("Select Model and Effort".to_string()),subtitle: Some(- "Access legacy models by running codex -m <model_name> or in your config"+ "Access legacy models by running codex -m <model_name> or in your config.toml".to_string(),),footer_hint: Some("Press enter to select reasoning effort, or esc to dismiss.".into()),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.snapindex de9016c61d..6cfce48b89 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@@ -3,7 +3,7 @@ source: tui/src/chatwidget/tests.rsexpression: popup---Select Model and Effort- Access legacy models by running codex -m <model_name> or in your config+ Access legacy models by running codex -m <model_name> or in your config.toml› 1. gpt-5.1-codex Optimized for codex.2. gpt-5.1-codex-mini Optimized for codex. Cheaper, faster, but lessdiff --git a/codex-rs/tui/src/model_migration.rs b/codex-rs/tui/src/model_migration.rsindex 8a1482e123..ee253c4e0e 100644--- a/codex-rs/tui/src/model_migration.rs+++ b/codex-rs/tui/src/model_migration.rs@@ -24,10 +24,7 @@ pub(crate) enum ModelMigrationOutcome {Exit,}-pub(crate) async fn run_model_migration_prompt(- tui: &mut Tui,- target_model: &str,-) -> ModelMigrationOutcome {+pub(crate) async fn run_model_migration_prompt(tui: &mut Tui) -> ModelMigrationOutcome {// Render the prompt on the terminal's alternate screen so exiting or cancelling// does not leave a large blank region in the normal scrollback. This does not// change the prompt's appearance – only where it is drawn.@@ -48,7 +45,7 @@ pub(crate) async fn run_model_migration_prompt(let alt = AltScreenGuard::enter(tui);- let mut screen = ModelMigrationScreen::new(alt.tui.frame_requester(), target_model);+ let mut screen = ModelMigrationScreen::new(alt.tui.frame_requester());let _ = alt.tui.draw(u16::MAX, |frame| {frame.render_widget_ref(&screen, frame.area());@@ -79,16 +76,14 @@ pub(crate) async fn run_model_migration_prompt(struct ModelMigrationScreen {request_frame: FrameRequester,- target_model: String,done: bool,should_exit: bool,}impl ModelMigrationScreen {- fn new(request_frame: FrameRequester, target_model: &str) -> Self {+ fn new(request_frame: FrameRequester) -> Self {Self {request_frame,- target_model: target_model.to_string(),done: false,should_exit: false,}@@ -140,10 +135,7 @@ impl WidgetRef for &ModelMigrationScreen {column.push("");column.push(Line::from(vec!["> ".into(),- "Introducing ".bold(),- "our ".bold(),- self.target_model.clone().bold(),- " models".bold(),+ "Introducing our gpt-5.1 models".bold(),]));column.push(Line::from(""));@@ -199,7 +191,7 @@ mod tests {let mut terminal = Terminal::with_options(backend).expect("terminal");terminal.set_viewport_area(Rect::new(0, 0, width, height));- let screen = ModelMigrationScreen::new(FrameRequester::test_dummy(), "gpt-5.1-codex");+ let screen = ModelMigrationScreen::new(FrameRequester::test_dummy());{let mut frame = terminal.get_frame();@@ -216,7 +208,7 @@ mod tests {let mut terminal = Terminal::with_options(backend).expect("terminal");terminal.set_viewport_area(Rect::new(0, 0, 65, 12));- let screen = ModelMigrationScreen::new(FrameRequester::test_dummy(), "gpt-5.1");+ let screen = ModelMigrationScreen::new(FrameRequester::test_dummy());{let mut frame = terminal.get_frame();frame.render_widget_ref(&screen, frame.area());@@ -231,7 +223,7 @@ mod tests {let mut terminal = Terminal::with_options(backend).expect("terminal");terminal.set_viewport_area(Rect::new(0, 0, 60, 12));- let screen = ModelMigrationScreen::new(FrameRequester::test_dummy(), "gpt-5.1-codex");+ let screen = ModelMigrationScreen::new(FrameRequester::test_dummy());{let mut frame = terminal.get_frame();frame.render_widget_ref(&screen, frame.area());@@ -246,7 +238,7 @@ mod tests {let mut terminal = Terminal::with_options(backend).expect("terminal");terminal.set_viewport_area(Rect::new(0, 0, 60, 12));- let screen = ModelMigrationScreen::new(FrameRequester::test_dummy(), "gpt-5.1-codex-mini");+ let screen = ModelMigrationScreen::new(FrameRequester::test_dummy());{let mut frame = terminal.get_frame();frame.render_widget_ref(&screen, frame.area());@@ -257,8 +249,7 @@ mod tests {#[test]fn escape_key_accepts_prompt() {- let screen_target = "gpt-5.1-codex";- let mut screen = ModelMigrationScreen::new(FrameRequester::test_dummy(), screen_target);+ let mut screen = ModelMigrationScreen::new(FrameRequester::test_dummy());// Simulate pressing Escapescreen.handle_key(KeyEvent::new(diff --git a/codex-rs/tui/src/snapshots/codex_tui__model_migration__tests__model_migration_prompt.snap b/codex-rs/tui/src/snapshots/codex_tui__model_migration__tests__model_migration_prompt.snapindex aeef4875dc..5a0ccd9b5b 100644--- a/codex-rs/tui/src/snapshots/codex_tui__model_migration__tests__model_migration_prompt.snap+++ b/codex-rs/tui/src/snapshots/codex_tui__model_migration__tests__model_migration_prompt.snap@@ -2,7 +2,7 @@source: tui/src/model_migration.rsexpression: terminal.backend()----> Introducing our gpt-5.1-codex models+> Introducing our gpt-5.1 modelsWe've upgraded our family of models supported in Codex togpt-5.1, gpt-5.1-codex and gpt-5.1-codex-mini.diff --git a/codex-rs/tui/src/snapshots/codex_tui__model_migration__tests__model_migration_prompt_gpt5_codex.snap b/codex-rs/tui/src/snapshots/codex_tui__model_migration__tests__model_migration_prompt_gpt5_codex.snapindex aeef4875dc..5a0ccd9b5b 100644--- a/codex-rs/tui/src/snapshots/codex_tui__model_migration__tests__model_migration_prompt_gpt5_codex.snap+++ b/codex-rs/tui/src/snapshots/codex_tui__model_migration__tests__model_migration_prompt_gpt5_codex.snap@@ -2,7 +2,7 @@source: tui/src/model_migration.rsexpression: terminal.backend()----> Introducing our gpt-5.1-codex models+> Introducing our gpt-5.1 modelsWe've upgraded our family of models supported in Codex togpt-5.1, gpt-5.1-codex and gpt-5.1-codex-mini.diff --git a/codex-rs/tui/src/snapshots/codex_tui__model_migration__tests__model_migration_prompt_gpt5_codex_mini.snap b/codex-rs/tui/src/snapshots/codex_tui__model_migration__tests__model_migration_prompt_gpt5_codex_mini.snapindex 9ca1eb450d..5a0ccd9b5b 100644--- a/codex-rs/tui/src/snapshots/codex_tui__model_migration__tests__model_migration_prompt_gpt5_codex_mini.snap+++ b/codex-rs/tui/src/snapshots/codex_tui__model_migration__tests__model_migration_prompt_gpt5_codex_mini.snap@@ -2,7 +2,7 @@source: tui/src/model_migration.rsexpression: terminal.backend()----> Introducing our gpt-5.1-codex-mini models+> Introducing our gpt-5.1 modelsWe've upgraded our family of models supported in Codex togpt-5.1, gpt-5.1-codex and gpt-5.1-codex-mini.