From 18d00e36b9b89f42e0bd8c8da128ca2069e1ebf3 Mon Sep 17 00:00:00 2001 From: joshka-oai Date: Wed, 15 Oct 2025 14:57:05 -0700 Subject: [PATCH] feat(tui): warn high effort rate use (#5035) Highlight that selecting a high reasoning level will hit Plus plan rate limits faster. --- .../src/bottom_pane/list_selection_view.rs | 7 ++++++- codex-rs/tui/src/chatwidget.rs | 21 ++++++++++++++++--- ...ests__model_reasoning_selection_popup.snap | 5 +++-- 3 files changed, 27 insertions(+), 6 deletions(-) diff --git a/codex-rs/tui/src/bottom_pane/list_selection_view.rs b/codex-rs/tui/src/bottom_pane/list_selection_view.rs index 1e8d1983..44d7b264 100644 --- a/codex-rs/tui/src/bottom_pane/list_selection_view.rs +++ b/codex-rs/tui/src/bottom_pane/list_selection_view.rs @@ -37,6 +37,7 @@ pub(crate) struct SelectionItem { pub name: String, pub display_shortcut: Option, pub description: Option, + pub selected_description: Option, pub is_current: bool, pub actions: Vec, pub dismiss_on_select: bool, @@ -193,12 +194,16 @@ impl ListSelectionView { } else { format!("{prefix} {n}. {name_with_marker}") }; + let description = is_selected + .then(|| item.selected_description.clone()) + .flatten() + .or_else(|| item.description.clone()); GenericDisplayRow { name: display_name, display_shortcut: item.display_shortcut, match_indices: None, is_current: item.is_current, - description: item.description.clone(), + description, } }) }) diff --git a/codex-rs/tui/src/chatwidget.rs b/codex-rs/tui/src/chatwidget.rs index 787e0980..bd0893bc 100644 --- a/codex-rs/tui/src/chatwidget.rs +++ b/codex-rs/tui/src/chatwidget.rs @@ -53,6 +53,8 @@ use ratatui::buffer::Buffer; use ratatui::layout::Constraint; use ratatui::layout::Layout; use ratatui::layout::Rect; +use ratatui::style::Stylize; +use ratatui::text::Line; use ratatui::widgets::Widget; use ratatui::widgets::WidgetRef; use tokio::sync::mpsc::UnboundedSender; @@ -81,6 +83,7 @@ use crate::history_cell::AgentMessageCell; use crate::history_cell::HistoryCell; use crate::history_cell::McpToolCallCell; use crate::markdown::append_markdown; +use crate::render::renderable::ColumnRenderable; use crate::slash_command::SlashCommand; use crate::status::RateLimitSnapshotDisplay; use crate::text_formatting::truncate_text; @@ -1718,7 +1721,6 @@ impl ChatWidget { } else { default_choice }; - let mut items: Vec = Vec::new(); for choice in choices.iter() { let effort = choice.display; @@ -1741,6 +1743,14 @@ impl ChatWidget { .map(|preset| preset.description.to_string()) }); + let warning = "⚠ High reasoning effort can quickly consume Plus plan rate limits."; + let show_warning = model_slug == "gpt-5-codex" && effort == ReasoningEffortConfig::High; + let selected_description = show_warning.then(|| { + description + .as_ref() + .map_or(warning.to_string(), |d| format!("{d}\n{warning}")) + }); + let model_for_action = model_slug.clone(); let effort_for_action = choice.stored; let actions: Vec = vec![Box::new(move |tx| { @@ -1770,6 +1780,7 @@ impl ChatWidget { items.push(SelectionItem { name: effort_label, description, + selected_description, is_current: is_current_model && choice.stored == highlight_choice, actions, dismiss_on_select: true, @@ -1777,9 +1788,13 @@ impl ChatWidget { }); } + let mut header = ColumnRenderable::new(); + header.push(Line::from( + format!("Select Reasoning Level for {model_slug}").bold(), + )); + self.bottom_pane.show_selection_view(SelectionViewParams { - title: Some("Select Reasoning Level".to_string()), - subtitle: Some(format!("Reasoning for model {model_slug}")), + header: Box::new(header), footer_hint: Some(standard_popup_hint_line()), items, ..Default::default() diff --git a/codex-rs/tui/src/chatwidget/snapshots/codex_tui__chatwidget__tests__model_reasoning_selection_popup.snap b/codex-rs/tui/src/chatwidget/snapshots/codex_tui__chatwidget__tests__model_reasoning_selection_popup.snap index 664ec0f5..d2ef858a 100644 --- a/codex-rs/tui/src/chatwidget/snapshots/codex_tui__chatwidget__tests__model_reasoning_selection_popup.snap +++ b/codex-rs/tui/src/chatwidget/snapshots/codex_tui__chatwidget__tests__model_reasoning_selection_popup.snap @@ -2,12 +2,13 @@ source: tui/src/chatwidget/tests.rs expression: popup --- - Select Reasoning Level - Reasoning for model gpt-5-codex + Select Reasoning Level for gpt-5-codex 1. Low Fastest responses with limited reasoning 2. Medium (default) Dynamically adjusts reasoning based on the task › 3. High (current) Maximizes reasoning depth for complex or ambiguous problems + ⚠ High reasoning effort can quickly consume Plus plan + rate limits. Press enter to confirm or esc to go back