Skip to content

armgit / codex

Public Imported from GitHub
0

Lightweight coding agent that runs in your terminal

Rust

Fix TUI fast mode toggle regression (#16833)

Eric Trautab58141e2251
diff --git a/codex-rs/tui/src/chatwidget.rs b/codex-rs/tui/src/chatwidget.rs
index b0ddb631bd..454c9053b0 100644
--- a/codex-rs/tui/src/chatwidget.rs
+++ b/codex-rs/tui/src/chatwidget.rs
@@ -5767,7 +5767,7 @@ impl ChatWidget {
.personality
.filter(|_| self.config.features.enabled(Feature::Personality))
.filter(|_| self.current_model_supports_personality());
- let service_tier = self.config.service_tier.map(Some);
+ let service_tier = Some(self.config.service_tier);
let op = AppCommand::user_turn(
items,
self.config.cwd.to_path_buf(),
diff --git a/codex-rs/tui/src/chatwidget/tests/slash_commands.rs b/codex-rs/tui/src/chatwidget/tests/slash_commands.rs
index 76ab5bc956..c6fff59897 100644
--- a/codex-rs/tui/src/chatwidget/tests/slash_commands.rs
+++ b/codex-rs/tui/src/chatwidget/tests/slash_commands.rs
@@ -622,6 +622,32 @@ async fn user_turn_carries_service_tier_after_fast_toggle() {
}
}
+#[tokio::test]
+async fn user_turn_clears_service_tier_after_fast_is_turned_off() {
+ let (mut chat, mut rx, mut op_rx) = make_chatwidget_manual(Some("gpt-5.3-codex")).await;
+ chat.thread_id = Some(ThreadId::new());
+ set_chatgpt_auth(&mut chat);
+ chat.set_feature_enabled(Feature::FastMode, /*enabled*/ true);
+
+ chat.dispatch_command(SlashCommand::Fast);
+ let _events = std::iter::from_fn(|| rx.try_recv().ok()).collect::<Vec<_>>();
+
+ chat.dispatch_command_with_args(SlashCommand::Fast, "off".to_string(), Vec::new());
+ let _events = std::iter::from_fn(|| rx.try_recv().ok()).collect::<Vec<_>>();
+
+ chat.bottom_pane
+ .set_composer_text("hello".to_string(), Vec::new(), Vec::new());
+ chat.handle_key_event(KeyEvent::from(KeyCode::Enter));
+
+ match next_submit_op(&mut op_rx) {
+ Op::UserTurn {
+ service_tier: Some(None),
+ ..
+ } => {}
+ other => panic!("expected Op::UserTurn to clear service tier, got {other:?}"),
+ }
+}
+
#[tokio::test]
async fn compact_queues_user_messages_snapshot() {
let (mut chat, _rx, _op_rx) = make_chatwidget_manual(/*model_override*/ None).await;