Lightweight coding agent that runs in your terminal
Rust
Show a short, neutral TUI interruption notice (#48830)
Felipe Coury1cc7e2361237
diff --git a/codex-rs/tui/src/app/tests/snapshots/codex_tui__app__tests__math_interruption_tests__answer_math_narrow.snap b/codex-rs/tui/src/app/tests/snapshots/codex_tui__app__tests__math_interruption_tests__answer_math_narrow.snapindex 7cf1280f79..cfd9920adb 100644--- a/codex-rs/tui/src/app/tests/snapshots/codex_tui__app__tests__math_interruption_tests__answer_math_narrow.snap+++ b/codex-rs/tui/src/app/tests/snapshots/codex_tui__app__tests__math_interruption_tests__answer_math_narrow.snap@@ -8,4 +8,4 @@ expression: rendered\frac{a+b+c+d+e+f}{g+h}-■ Conversation interrupted - tell the model what to do differently. Something went wrong? Hit `/feedback` to report the issue.+■ Conversation interrupted - use /feedback if something went wrongdiff --git a/codex-rs/tui/src/app/tests/snapshots/codex_tui__app__tests__math_interruption_tests__plan_math_narrow.snap b/codex-rs/tui/src/app/tests/snapshots/codex_tui__app__tests__math_interruption_tests__plan_math_narrow.snapindex 7ca58045f1..eb99d8da7a 100644--- a/codex-rs/tui/src/app/tests/snapshots/codex_tui__app__tests__math_interruption_tests__plan_math_narrow.snap+++ b/codex-rs/tui/src/app/tests/snapshots/codex_tui__app__tests__math_interruption_tests__plan_math_narrow.snap@@ -12,4 +12,4 @@ expression: renderedf}{g+h}-■ Conversation interrupted - tell the model what to do differently. Something went wrong? Hit `/feedback` to report the issue.+■ Conversation interrupted - use /feedback if something went wrongdiff --git a/codex-rs/tui/src/chatwidget/input_restore.rs b/codex-rs/tui/src/chatwidget/input_restore.rsindex 565a56d950..3c47f6dcfa 100644--- a/codex-rs/tui/src/chatwidget/input_restore.rs+++ b/codex-rs/tui/src/chatwidget/input_restore.rs@@ -323,9 +323,17 @@ impl ChatWidget {/*hint*/ None,));} else {- self.add_to_history(history_cell::new_error_event(- self.interrupted_turn_message(reason),- ));+ self.add_to_history(match reason {+ TurnAbortReason::BudgetLimited => history_cell::new_error_event(+ "Goal budget reached - the turn was stopped.".to_string(),+ ),+ TurnAbortReason::Interrupted => PlainHistoryCell::new(vec![+ Line::from(+ "■ Conversation interrupted - use /feedback if something went wrong",+ )+ .style(crate::style::secondary_text_style()),+ ]),+ });}}diff --git a/codex-rs/tui/src/chatwidget/snapshots/codex_tui__chatwidget__tests__interrupt_preserves_unified_exec_wait_streak.snap b/codex-rs/tui/src/chatwidget/snapshots/codex_tui__chatwidget__tests__interrupt_preserves_unified_exec_wait_streak.snapindex bf70c40460..0e43f3017b 100644--- a/codex-rs/tui/src/chatwidget/snapshots/codex_tui__chatwidget__tests__interrupt_preserves_unified_exec_wait_streak.snap+++ b/codex-rs/tui/src/chatwidget/snapshots/codex_tui__chatwidget__tests__interrupt_preserves_unified_exec_wait_streak.snap@@ -1,6 +1,6 @@----source: tui/src/chatwidget/tests.rs+source: tui/src/chatwidget/tests/exec_flow.rsexpression: snapshot---cells=1-■ Conversation interrupted - tell the model what to do differently. Something went wrong? Hit `/feedback` to report the issue.+■ Conversation interrupted - use /feedback if something went wrongdiff --git a/codex-rs/tui/src/chatwidget/snapshots/codex_tui__chatwidget__tests__interrupted_turn_error_message.snap b/codex-rs/tui/src/chatwidget/snapshots/codex_tui__chatwidget__tests__interrupted_turn_error_message.snapindex 60715e581e..c30168d5c1 100644--- a/codex-rs/tui/src/chatwidget/snapshots/codex_tui__chatwidget__tests__interrupted_turn_error_message.snap+++ b/codex-rs/tui/src/chatwidget/snapshots/codex_tui__chatwidget__tests__interrupted_turn_error_message.snap@@ -1,5 +1,5 @@----source: tui/src/chatwidget/tests.rs+source: tui/src/chatwidget/tests/review_mode.rsexpression: last----■ Conversation interrupted - tell the model what to do differently. Something went wrong? Hit `/feedback` to report the issue.+■ Conversation interrupted - use /feedback if something went wrongdiff --git a/codex-rs/tui/src/chatwidget/tests/composer_submission.rs b/codex-rs/tui/src/chatwidget/tests/composer_submission.rsindex 9c70a5593d..0646bb1bf6 100644--- a/codex-rs/tui/src/chatwidget/tests/composer_submission.rs+++ b/codex-rs/tui/src/chatwidget/tests/composer_submission.rs@@ -1670,7 +1670,7 @@ fn interrupted_history(}let history = history.join("\n");assert!(- history.contains("Conversation interrupted - tell the model what to do differently."),+ history.contains("Conversation interrupted"),"expected normal interruption notice, got {history:?}");(saw_prompt, history)diff --git a/codex-rs/tui/src/chatwidget/tests/review_mode.rs b/codex-rs/tui/src/chatwidget/tests/review_mode.rsindex 3410dabed2..65d6acb0eb 100644--- a/codex-rs/tui/src/chatwidget/tests/review_mode.rs+++ b/codex-rs/tui/src/chatwidget/tests/review_mode.rs@@ -1218,8 +1218,7 @@ async fn interrupt_exec_marks_failed_snapshot() {assert_chatwidget_snapshot!("interrupt_exec_marks_failed", exec_blob);}-// Snapshot test: after an interrupted turn, a gentle error message is inserted-// suggesting the user to tell the model what to do differently and to use /feedback.+// Interruptions show a short, neutral notice with the feedback command.#[tokio::test]async fn interrupted_turn_error_message_snapshot() {let (mut chat, mut rx, _op_rx) = make_chatwidget_manual(/*model_override*/ None).await;@@ -1233,9 +1232,18 @@ async fn interrupted_turn_error_message_snapshot() {let cells = drain_insert_history(&mut rx);assert!(!cells.is_empty(),- "expected error message to be inserted after interruption"+ "expected notice to be inserted after interruption");- let last = lines_to_single_string(cells.last().unwrap());+ let last = cells.last().unwrap();+ let line = last.last().unwrap();+ assert_eq!(+ line.spans+ .iter()+ .map(|span| line.style.patch(span.style))+ .collect::<Vec<_>>(),+ vec![crate::style::secondary_text_style(); line.spans.len()]+ );+ let last = lines_to_single_string(last);assert_chatwidget_snapshot!("interrupted_turn_error_message", last);}@@ -1336,9 +1344,7 @@ async fn budget_limited_turn_restores_queued_input_without_submitting() {assert_no_submit_op(&mut op_rx);}-// Snapshot test: interrupting specifically to submit pending steers shows an-// informational banner instead of the generic "tell the model what to do-// differently" error prompt.+// Interrupting to submit pending steers shows the steer-specific notice.#[tokio::test]async fn interrupted_turn_pending_steers_message_snapshot() {let (mut chat, mut rx, _op_rx) = make_chatwidget_manual(/*model_override*/ None).await;diff --git a/codex-rs/tui/src/chatwidget/tests/side.rs b/codex-rs/tui/src/chatwidget/tests/side.rsindex 43b68a1ad9..7a1e085af3 100644--- a/codex-rs/tui/src/chatwidget/tests/side.rs+++ b/codex-rs/tui/src/chatwidget/tests/side.rs@@ -41,7 +41,7 @@ async fn suppressed_interrupted_turn_notice_skips_history_warning() {assert!(inserted.iter().all(|cell| {let rendered = lines_to_single_string(cell);- !rendered.contains("Conversation interrupted - tell the model what to do differently.")+ !rendered.contains("Conversation interrupted")&& !rendered.contains("Model interrupted to submit steer instructions.")}),"unexpected interrupted-turn notice in side conversation: {inserted:?}"diff --git a/codex-rs/tui/src/chatwidget/tests/snapshots/codex_tui__chatwidget__tests__composer_submission__output_free_ctrl_c_interrupt_keeps_prompt_and_blank_composer.snap b/codex-rs/tui/src/chatwidget/tests/snapshots/codex_tui__chatwidget__tests__composer_submission__output_free_ctrl_c_interrupt_keeps_prompt_and_blank_composer.snapindex d0cb7e3c48..e1caf751e5 100644--- a/codex-rs/tui/src/chatwidget/tests/snapshots/codex_tui__chatwidget__tests__composer_submission__output_free_ctrl_c_interrupt_keeps_prompt_and_blank_composer.snap+++ b/codex-rs/tui/src/chatwidget/tests/snapshots/codex_tui__chatwidget__tests__composer_submission__output_free_ctrl_c_interrupt_keeps_prompt_and_blank_composer.snap@@ -7,6 +7,6 @@ history:› revise this prompt-■ Conversation interrupted - tell the model what to do differently. Something went wrong? Hit `/feedback` to report the issue.+■ Conversation interrupted - use /feedback if something went wrongcomposer:diff --git a/codex-rs/tui/src/chatwidget/tests/snapshots/codex_tui__chatwidget__tests__history_replay__replayed_nested_review_prompts.snap b/codex-rs/tui/src/chatwidget/tests/snapshots/codex_tui__chatwidget__tests__history_replay__replayed_nested_review_prompts.snapindex 36e9b00ffc..b4b943060a 100644--- a/codex-rs/tui/src/chatwidget/tests/snapshots/codex_tui__chatwidget__tests__history_replay__replayed_nested_review_prompts.snap+++ b/codex-rs/tui/src/chatwidget/tests/snapshots/codex_tui__chatwidget__tests__history_replay__replayed_nested_review_prompts.snap@@ -14,7 +14,7 @@ expression: rendered› current changes-■ Conversation interrupted - tell the model what to do differently. Something went wrong? Hit `/feedback` to report the issue.+■ Conversation interrupted - use /feedback if something went wrong>> Code review started: current changes <<diff --git a/codex-rs/tui/src/chatwidget/turn_runtime.rs b/codex-rs/tui/src/chatwidget/turn_runtime.rsindex bad721b9ca..137220567c 100644--- a/codex-rs/tui/src/chatwidget/turn_runtime.rs+++ b/codex-rs/tui/src/chatwidget/turn_runtime.rs@@ -556,12 +556,4 @@ impl ChatWidget {self.refresh_status_surfaces();self.add_to_history(history_cell::new_plan_update(update));}-- pub(super) fn interrupted_turn_message(&self, reason: TurnAbortReason) -> String {- if reason == TurnAbortReason::BudgetLimited {- return "Goal budget reached - the turn was stopped.".to_string();- }-- "Conversation interrupted - tell the model what to do differently. Something went wrong? Hit `/feedback` to report the issue.".to_string()- }}