Lightweight coding agent that runs in your terminal
Rust
chore: rename for clarity (#6319)
Thibault Sottiaux649ce520c435
diff --git a/codex-rs/common/src/model_presets.rs b/codex-rs/common/src/model_presets.rsindex 5337f68b7e..b011fe9b60 100644--- a/codex-rs/common/src/model_presets.rs+++ b/codex-rs/common/src/model_presets.rs@@ -53,10 +53,10 @@ const PRESETS: &[ModelPreset] = &[is_default: true,},ModelPreset {- id: "desertfox",- model: "desertfox",- display_name: "desertfox",- description: "???",+ id: "gpt-5-codex-mini",+ model: "gpt-5-codex-mini",+ display_name: "gpt-5-codex-mini",+ description: "Optimized for codex. Cheaper, faster, and less capable.",default_reasoning_effort: ReasoningEffort::Medium,supported_reasoning_efforts: &[ReasoningEffortPreset {@@ -99,10 +99,10 @@ const PRESETS: &[ModelPreset] = &[];pub fn builtin_model_presets(auth_mode: Option<AuthMode>) -> Vec<ModelPreset> {- let allow_desertfox = matches!(auth_mode, Some(AuthMode::ChatGPT));+ let allow_codex_mini = matches!(auth_mode, Some(AuthMode::ChatGPT));PRESETS.iter()- .filter(|preset| allow_desertfox || preset.id != "desertfox")+ .filter(|preset| allow_codex_mini || preset.id != "gpt-5-codex-mini").copied().collect()}diff --git a/codex-rs/tui/src/chatwidget.rs b/codex-rs/tui/src/chatwidget.rsindex f852ae9f24..304adc7548 100644--- a/codex-rs/tui/src/chatwidget.rs+++ b/codex-rs/tui/src/chatwidget.rs@@ -132,7 +132,7 @@ struct RunningCommand {}const RATE_LIMIT_WARNING_THRESHOLDS: [f64; 3] = [75.0, 90.0, 95.0];-const NUDGE_MODEL_SLUG: &str = "gpt-5-codex";+const NUDGE_MODEL_SLUG: &str = "gpt-5-codex-mini";const RATE_LIMIT_SWITCH_PROMPT_THRESHOLD: f64 = 90.0;#[derive(Default)]diff --git a/codex-rs/tui/src/chatwidget/snapshots/codex_tui__chatwidget__tests__rate_limit_switch_prompt_popup.snap b/codex-rs/tui/src/chatwidget/snapshots/codex_tui__chatwidget__tests__rate_limit_switch_prompt_popup.snapindex 32fb3a7f39..c4495fe9df 100644--- a/codex-rs/tui/src/chatwidget/snapshots/codex_tui__chatwidget__tests__rate_limit_switch_prompt_popup.snap+++ b/codex-rs/tui/src/chatwidget/snapshots/codex_tui__chatwidget__tests__rate_limit_switch_prompt_popup.snap@@ -1,12 +1,13 @@---source: tui/src/chatwidget/tests.rs-assertion_line: 474+assertion_line: 480expression: popup---Approaching rate limits- You've used over 90% of your limit. Switch to gpt-5-codex for lower credit u+ You've used over 90% of your limit. Switch to gpt-5-codex-mini for lower cre-› 1. Switch to gpt-5-codex Optimized for codex.+› 1. Switch to gpt-5-codex-mini Optimized for codex. Cheaper, faster, and+ less capable.2. Keep current modelPress enter to confirm or esc to go backdiff --git a/codex-rs/tui/src/chatwidget/tests.rs b/codex-rs/tui/src/chatwidget/tests.rsindex 22cc1e9253..e035ce3bed 100644--- a/codex-rs/tui/src/chatwidget/tests.rs+++ b/codex-rs/tui/src/chatwidget/tests.rs@@ -411,6 +411,8 @@ fn test_rate_limit_warnings_monthly() {#[test]fn rate_limit_switch_prompt_skips_when_on_lower_cost_model() {let (mut chat, _, _) = make_chatwidget_manual();+ chat.auth_manager =+ AuthManager::from_auth_for_testing(CodexAuth::create_dummy_chatgpt_auth_for_testing());chat.config.model = NUDGE_MODEL_SLUG.to_string();chat.on_rate_limit_snapshot(Some(snapshot(95.0)));@@ -423,8 +425,10 @@ fn rate_limit_switch_prompt_skips_when_on_lower_cost_model() {#[test]fn rate_limit_switch_prompt_shows_once_per_session() {+ let auth = CodexAuth::create_dummy_chatgpt_auth_for_testing();let (mut chat, _, _) = make_chatwidget_manual();chat.config.model = "gpt-5".to_string();+ chat.auth_manager = AuthManager::from_auth_for_testing(auth);chat.on_rate_limit_snapshot(Some(snapshot(90.0)));assert!(@@ -446,8 +450,10 @@ fn rate_limit_switch_prompt_shows_once_per_session() {#[test]fn rate_limit_switch_prompt_defers_until_task_complete() {+ let auth = CodexAuth::create_dummy_chatgpt_auth_for_testing();let (mut chat, _, _) = make_chatwidget_manual();chat.config.model = "gpt-5".to_string();+ chat.auth_manager = AuthManager::from_auth_for_testing(auth);chat.bottom_pane.set_task_running(true);chat.on_rate_limit_snapshot(Some(snapshot(90.0)));@@ -467,6 +473,8 @@ fn rate_limit_switch_prompt_defers_until_task_complete() {#[test]fn rate_limit_switch_prompt_popup_snapshot() {let (mut chat, _rx, _op_rx) = make_chatwidget_manual();+ chat.auth_manager =+ AuthManager::from_auth_for_testing(CodexAuth::create_dummy_chatgpt_auth_for_testing());chat.config.model = "gpt-5".to_string();chat.on_rate_limit_snapshot(Some(snapshot(92.0)));