You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
ESC cancel does not stop a queued or still-preparing prompt/command from starting a new LLM run #693
Pressing ESC (SessionPrompt.cancel / SessionPrompt.cancelForeground) after submitting a prompt or slash command does not reliably cancel it: a fresh provider LLM run can still start after the user cancelled.
Scenarios:
Cancel lands while SessionPrompt.prompt / command is still doing async preparation (revert cleanup, command template / ! shell / @file / MCP resolution, message/part persistence, plugin hooks) before entering the run loop. The loop then samples the post-cancel cancelEpoch and starts a run anyway.
Cancel on an idle session (or during the loop's re-entry gap after Runner.onIdle removed the runner) makes cancelForeground return early without incrementing cancelEpoch, and the loop does not re-check the epoch at the top before ensureRunning.
A queued caller that exits early on an epoch change while cancellation is still settling can read lastAssistant before the interrupted assistant settles (MessageAbortedError / time.completed).
Expected: after ESC, no new provider run starts for the cancelled prompt/command, and queued callers observe the settled interruption.
Activity