mirror of
https://github.com/pchuan98/codex.git
synced 2026-07-01 00:31:56 +08:00
nit: ui on interruption (#9606)
This commit is contained in:
committed by
GitHub
Unverified
parent
2338f99f58
commit
338f2d634b
@@ -1010,6 +1010,7 @@ impl ChatWidget {
|
||||
self.running_commands.clear();
|
||||
self.suppressed_exec_calls.clear();
|
||||
self.last_unified_wait = None;
|
||||
self.unified_exec_wait_streak = None;
|
||||
self.clear_unified_exec_processes();
|
||||
self.stream_controller = None;
|
||||
self.maybe_show_pending_rate_limit_prompt();
|
||||
|
||||
+6
@@ -0,0 +1,6 @@
|
||||
---
|
||||
source: tui/src/chatwidget/tests.rs
|
||||
expression: snapshot
|
||||
---
|
||||
cells=1
|
||||
■ Conversation interrupted - tell the model what to do differently. Something went wrong? Hit `/feedback` to report the issue.
|
||||
@@ -3393,6 +3393,38 @@ async fn interrupt_clears_unified_exec_processes() {
|
||||
let _ = drain_insert_history(&mut rx);
|
||||
}
|
||||
|
||||
#[tokio::test]
|
||||
async fn interrupt_clears_unified_exec_wait_streak_snapshot() {
|
||||
let (mut chat, mut rx, _op_rx) = make_chatwidget_manual(None).await;
|
||||
|
||||
chat.handle_codex_event(Event {
|
||||
id: "turn-1".into(),
|
||||
msg: EventMsg::TurnStarted(TurnStartedEvent {
|
||||
model_context_window: None,
|
||||
}),
|
||||
});
|
||||
|
||||
let begin = begin_unified_exec_startup(&mut chat, "call-1", "process-1", "just fix");
|
||||
terminal_interaction(&mut chat, "call-1a", "process-1", "");
|
||||
|
||||
chat.handle_codex_event(Event {
|
||||
id: "turn-1".into(),
|
||||
msg: EventMsg::TurnAborted(codex_core::protocol::TurnAbortedEvent {
|
||||
reason: TurnAbortReason::Interrupted,
|
||||
}),
|
||||
});
|
||||
|
||||
end_exec(&mut chat, begin, "", "", 0);
|
||||
let cells = drain_insert_history(&mut rx);
|
||||
let combined = cells
|
||||
.iter()
|
||||
.map(|lines| lines_to_single_string(lines))
|
||||
.collect::<Vec<_>>()
|
||||
.join("\n");
|
||||
let snapshot = format!("cells={}\n{combined}", cells.len());
|
||||
assert_snapshot!("interrupt_clears_unified_exec_wait_streak", snapshot);
|
||||
}
|
||||
|
||||
#[tokio::test]
|
||||
async fn turn_complete_clears_unified_exec_processes() {
|
||||
let (mut chat, mut rx, _op_rx) = make_chatwidget_manual(None).await;
|
||||
|
||||
Reference in New Issue
Block a user