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/safety_buffering.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ use codex_app_server_protocol::ModelSafetyBufferingUpdatedNotification;

const SAFETY_BUFFERING_PROMPT_VIEW_ID: &str = "safety-buffering-prompt";

const SAFETY_BUFFERING_MESSAGE_WITH_RETRY: &str = "This request requires additional safety checks, which can take extra time. You can retry with a faster model for a quicker response, though it may be less capable of handling complex requests.";
const SAFETY_BUFFERING_MESSAGE_WITH_RETRY: &str = "This request requires additional safety checks, which can take extra time. Hang tight or retry with a faster model for a quicker response, though it may be less capable of handling complex requests.";
const SAFETY_BUFFERING_MESSAGE_WITHOUT_RETRY: &str =
"This request requires additional safety checks, which can take extra time.";

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@ expression: popup
---
Additional safety checks
This request requires additional safety checks, which can take extra time.
You can retry with a faster model for a quicker response, though it may be
less capable of handling complex requests.
Hang tight or retry with a faster model for a quicker response, though it
may be less capable of handling complex requests.

› 1. Retry with a faster model
2. Keep waiting
Expand Down
7 changes: 6 additions & 1 deletion codex-rs/tui/src/chatwidget/tests/app_server.rs
Original file line number Diff line number Diff line change
Expand Up @@ -146,7 +146,7 @@ async fn safety_buffering_offers_one_retry_with_app_wording() {
}

#[tokio::test]
async fn safety_buffering_stops_retrying_after_agent_message_starts() {
async fn safety_buffering_remains_visible_until_turn_completes() {
let (mut chat, _rx, mut op_rx) = make_chatwidget_manual(/*model_override*/ None).await;
let (thread_id, turn_id, _) = start_safety_buffering_test_turn(&mut chat, &mut op_rx);
chat.handle_server_notification(
Expand All @@ -162,6 +162,11 @@ async fn safety_buffering_stops_retrying_after_agent_message_starts() {
chat.on_agent_message_delta("Visible response".to_string());

assert!(!chat.can_retry_safety_buffered_turn(turn_id));
assert!(render_bottom_popup(&chat, /*width*/ 80).contains("Additional safety checks"));

handle_turn_completed(&mut chat, turn_id, /*duration_ms*/ None);

assert!(!render_bottom_popup(&chat, /*width*/ 80).contains("Additional safety checks"));
}

#[tokio::test]
Expand Down
1 change: 1 addition & 0 deletions codex-rs/tui/src/chatwidget/turn_runtime.rs
Original file line number Diff line number Diff line change
Expand Up @@ -170,6 +170,7 @@ impl ChatWidget {
self.input_queue.user_turn_pending_start = false;
self.clear_active_hook_cell();
self.turn_lifecycle.finish();
self.clear_safety_buffering();
self.update_task_running_state();
self.running_commands.clear();
self.suppressed_exec_calls.clear();
Expand Down
Loading