mirror of
https://github.com/openai/codex.git
synced 2026-11-13 14:46:14 +00:00
Hide Fast mode status for unsupported models (#39999)
## Why The `fast-mode` status item showed `Fast off` even when the selected model did not support Fast mode. ## What changed - Hide the Fast mode status value when the current model is known not to support Fast mode. - Continue showing the value for supported and uncatalogued models. ## Testing - Cover visibility updates when switching among supported, unsupported, and uncatalogued models. - Update the footer snapshot to verify that an unsupported model omits the Fast mode value. GitOrigin-RevId: c297655189efc719b2097c2aa415029b01d6873e
This commit is contained in:
1 parent
df6a54ee85
commit
9cdc66904f
3 files changed
+48
-12
No files matched your search
@@ -3806,7 +3806,8 @@ async fn completed_turn_clears_visible_running_hook() {
|
||||
|
||||
#[tokio::test]
|
||||
async fn status_line_fast_mode_renders_on_and_off() {
|
||||
let (mut chat, _rx, _op_rx) = make_chatwidget_manual(/*model_override*/ None).await;
|
||||
let (mut chat, _rx, _op_rx) = make_chatwidget_manual(Some("gpt-5.4")).await;
|
||||
set_fast_mode_test_catalog(&mut chat);
|
||||
chat.config.tui_status_line = Some(vec!["fast-mode".to_string()]);
|
||||
|
||||
chat.refresh_status_line();
|
||||
@@ -3817,15 +3818,40 @@ async fn status_line_fast_mode_renders_on_and_off() {
|
||||
assert_eq!(status_line_text(&chat), Some("Fast on".to_string()));
|
||||
}
|
||||
|
||||
#[tokio::test]
|
||||
async fn status_line_fast_mode_updates_visibility_on_model_change() {
|
||||
let (mut chat, _rx, _op_rx) = make_chatwidget_manual(Some("gpt-5.4")).await;
|
||||
set_fast_mode_test_catalog(&mut chat);
|
||||
chat.config.tui_status_line = Some(vec!["fast-mode".to_string()]);
|
||||
|
||||
chat.refresh_status_line();
|
||||
assert_eq!(status_line_text(&chat), Some("Fast off".to_string()));
|
||||
|
||||
chat.set_model("gpt-5.2");
|
||||
assert_eq!(status_line_text(&chat), None);
|
||||
|
||||
chat.set_model("gpt-5.4");
|
||||
assert_eq!(status_line_text(&chat), Some("Fast off".to_string()));
|
||||
|
||||
chat.set_model("uncatalogued-model");
|
||||
assert_eq!(status_line_text(&chat), Some("Fast off".to_string()));
|
||||
chat.set_service_tier(Some(ServiceTier::Fast.request_value().to_string()));
|
||||
assert_eq!(status_line_text(&chat), Some("Fast on".to_string()));
|
||||
}
|
||||
|
||||
#[tokio::test]
|
||||
async fn status_line_fast_mode_footer_snapshot() {
|
||||
use ratatui::Terminal;
|
||||
use ratatui::backend::TestBackend;
|
||||
|
||||
let (mut chat, _rx, _op_rx) = make_chatwidget_manual(/*model_override*/ None).await;
|
||||
let (mut chat, _rx, _op_rx) = make_chatwidget_manual(Some("gpt-5.2")).await;
|
||||
set_fast_mode_test_catalog(&mut chat);
|
||||
chat.show_welcome_banner = false;
|
||||
chat.config.tui_status_line = Some(vec!["fast-mode".to_string()]);
|
||||
chat.set_service_tier(Some(ServiceTier::Fast.request_value().to_string()));
|
||||
chat.config.tui_status_line = Some(vec![
|
||||
"model-with-reasoning".to_string(),
|
||||
"fast-mode".to_string(),
|
||||
]);
|
||||
chat.set_reasoning_effort(Some(ReasoningEffortConfig::High));
|
||||
chat.refresh_status_line();
|
||||
|
||||
let width = 80;
|
||||
|
||||
Reference in new issue
Block a user