mirror of
https://github.com/openai/codex.git
synced 2026-10-20 00:18:49 +00:00
Show a short, neutral TUI interruption notice (#48830)
## What changed Render interrupted turns with secondary text styling and shorter wording, removing the suggestion to tell the model what to do differently. ## Testing Update interruption snapshots and assert that the notice uses secondary text styling. GitOrigin-RevId: 7cb042ed9e6781d107a93d5677fa193f082c764d
This commit is contained in:
+1
-1
@@ -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 wrong
|
||||
|
||||
+1
-1
@@ -12,4 +12,4 @@ expression: rendered
|
||||
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 wrong
|
||||
|
||||
@@ -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()),
|
||||
]),
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
+2
-2
@@ -1,6 +1,6 @@
|
||||
---
|
||||
source: tui/src/chatwidget/tests.rs
|
||||
source: tui/src/chatwidget/tests/exec_flow.rs
|
||||
expression: 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 wrong
|
||||
|
||||
+2
-2
@@ -1,5 +1,5 @@
|
||||
---
|
||||
source: tui/src/chatwidget/tests.rs
|
||||
source: tui/src/chatwidget/tests/review_mode.rs
|
||||
expression: 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 wrong
|
||||
|
||||
@@ -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)
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -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:?}"
|
||||
|
||||
+1
-1
@@ -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 wrong
|
||||
|
||||
composer:
|
||||
|
||||
+1
-1
@@ -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 <<
|
||||
|
||||
|
||||
@@ -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()
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user