fix(tui/chatwidget): handle ExecCommandBegin before flushing queued interrupts to ensure running cell exists and prevent out-of-order End showing call_id instead of command

This commit is contained in:
James Peter
2025-09-01 18:20:10 +10:00
parent b3ff41d625
commit 74427d4123
+5 -1
View File
@@ -3164,9 +3164,13 @@ impl ChatWidget<'_> {
self.defer_or_handle(
|interrupts| interrupts.push_exec_begin(ev),
|this| {
// Finalize any active streaming sections, then establish
// the running Exec cell before flushing queued interrupts.
// This prevents an out‑of‑order ExecCommandEnd from being
// applied first (which would fall back to showing call_id).
this.finalize_active_stream();
this.flush_interrupt_queue();
this.handle_exec_begin_now(ev2);
this.flush_interrupt_queue();
},
);
}