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
Feature: Interrupt tool execution on priority message #7450
When an agent is executing a chain of tool calls, user messages queue until the chain completes. This means urgent messages (like 'STOP') don't interrupt the agent until it finishes its current work.
Proposed Solution
Add a mechanism to interrupt tool execution when a priority message arrives from the user. Options:
Check for queued messages between tool calls
Allow certain message patterns (e.g., 'STOP') to abort the current run
Expose a 'check for messages' tool the agent can call
Use Case
User sends 'STOP' while agent is running 5+ tool calls. Agent should see the message immediately, not after completing all 5 calls.
Context
Requested by user who needs real-time interrupt capability for agent oversight.
Reacted by Steven Salka, 肥鲇鱼, nickthecook, Alannjaf and Jon Low
+1 on this. Running an agent on Telegram — when I send a message while the agent is mid-turn (doing tool calls, polling Claude Code, etc.), it queues up and I can't interrupt or redirect. Would love a priority message flag or /stop that actually cancels the current turn immediately.
Current main already implements priority-run interruption through explicit stop handling, interrupt queue mode, and the interrupt-and-steer session API, so the issue request is satisfied.
What I checked:
Inbound interrupt queue mode aborts the active embedded run:get-reply-run checks for messages.queue.mode === "interrupt"; when the session lane is busy it clears queued lane work and calls abortEmbeddedPiRun(...) before continuing. (src/auto-reply/reply/get-reply-run.ts:597, a2221d6b4709)
Queue docs describe interrupt semantics: The queue concept doc now says interrupt aborts the active run for that session and runs the newest message; steer injects into the active run at the next model boundary. (docs/concepts/queue.md:29, a2221d6b4709)
Gateway sessions.steer explicitly interrupts active runs:interruptSessionRunIfActive aborts tracked chat runs, aborts embedded runs, clears queues, and waits for shutdown; sessions.steer invokes that path with interruptIfActive: true. (src/gateway/server-methods/sessions.ts:368, a2221d6b4709)
STOP-style messages are handled as out-of-band aborts: Gateway stop detection delegates to abort-text matching; tests cover /STOP!!!, stop please, halt, and multilingual stop phrases, and chat.send short-circuits to the abort path when such text arrives. (src/gateway/chat-abort.ts:13, a2221d6b4709)
Docs and changelog record shipped interrupt behavior: The public docs say /stop aborts the current run and sessions.steer is the interrupt-and-steer variant; the changelog records both /stop aborting between tool calls and Telegram keeping true abort requests on the control lane. (CHANGELOG.md:4702, a2221d6b4709)
So I’m closing this as already implemented rather than keeping a duplicate issue open.
Activity
Alannjaf commentedon Feb 10, 2026
+1 on this. Running an agent on Telegram — when I send a message while the agent is mid-turn (doing tool calls, polling Claude Code, etc.), it queues up and I can't interrupt or redirect. Would love a priority message flag or /stop that actually cancels the current turn immediately.
feat(agent-runner): abort active run on priority message during steer (…
steipete commentedon Apr 24, 2026
Closing this as implemented after Codex review.
Current main already implements priority-run interruption through explicit stop handling, interrupt queue mode, and the interrupt-and-steer session API, so the issue request is satisfied.
What I checked:
get-reply-runchecks formessages.queue.mode === "interrupt"; when the session lane is busy it clears queued lane work and callsabortEmbeddedPiRun(...)before continuing. (src/auto-reply/reply/get-reply-run.ts:597, a2221d6b4709)interruptaborts the active run for that session and runs the newest message;steerinjects into the active run at the next model boundary. (docs/concepts/queue.md:29, a2221d6b4709)interruptSessionRunIfActiveaborts tracked chat runs, aborts embedded runs, clears queues, and waits for shutdown;sessions.steerinvokes that path withinterruptIfActive: true. (src/gateway/server-methods/sessions.ts:368, a2221d6b4709)/STOP!!!,stop please,halt, and multilingual stop phrases, andchat.sendshort-circuits to the abort path when such text arrives. (src/gateway/chat-abort.ts:13, a2221d6b4709)/stopaborts the current run andsessions.steeris the interrupt-and-steer variant; the changelog records both/stopaborting between tool calls and Telegram keeping true abort requests on the control lane. (CHANGELOG.md:4702, a2221d6b4709)So I’m closing this as already implemented rather than keeping a duplicate issue open.
Review notes: reviewed against a2221d6b4709; fix evidence: commit 9a14e1695dbd.