Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion codex-rs/tui/src/chatwidget.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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(),
Expand Down
26 changes: 26 additions & 0 deletions codex-rs/tui/src/chatwidget/tests/slash_commands.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
Loading