cccc icon indicating copy to clipboard operation
cccc copied to clipboard

Feature Request: Priority Interrupt — allow users to interrupt generating agents and inject priority messages Description:

Open howold-lab opened this issue 9 months ago • 0 comments

Problem When a user sends a message to @all, all agents receive it simultaneously and begin generating responses in parallel. The user has no way to interrupt agents mid-generation, even if:

One agent has already provided a satisfactory answer and the others are still generating redundant content The user has already reached a conclusion and wants all agents to move on The user realizes the question was wrong and wants to correct it before agents finish Currently, agents are completely uninterruptible during generation — they cannot see new messages until their current response is fully generated and sent. This leads to wasted compute, redundant output, and a poor user experience where the user must wait for all agents to finish before the conversation can move forward.

Proposed Solution Introduce a priority interrupt message type that combines two actions:

Interrupt: Send SIGINT to all target agents’ PTY processes, stopping their current generation Inject: Once agents return to idle, immediately deliver the priority message so they process it next User Experience User sends a message marked as “priority” (via a UI button, keyboard shortcut, or message flag) All targeted agents that are currently generating get interrupted (equivalent to Ctrl+C) Agents receive the user’s priority message as their next input Agents continue working based on the user’s new directive Technical Approach The existing infrastructure already supports most of this:

runners/pty.py has _best_effort_killpg() for sending signals to PTY process groups (currently used for SIGTERM/SIGKILL in actor_stop) PtySession tracks output activity via last_output_at_monotonic() and idle state via idle_seconds() The delivery system (delivery.py) already has per-actor message queues with priority support What needs to be added:

PtySupervisor.interrupt_actor() — send SIGINT instead of SIGTERM (agent process stays alive) A new daemon operation actor_interrupt — exposed as an API endpoint Delivery trigger — when a priority message arrives and the target agent is actively generating, send SIGINT first, wait for idle, then deliver Scope MVP: PTY runner only (covers the primary use case) Frontend: Add a “priority send” button or shortcut in the message composer Future: Headless runner support, auto-cleanup of interrupted partial output in agent context Use Case: “Bidding” Discussion Model This enables a natural discussion pattern for multi-agent collaboration:

User broadcasts a question to all agents (@all) All agents start generating responses in parallel (“bidding”) User sees one satisfactory answer → sends a priority message with their conclusion Remaining agents are interrupted and immediately align with the user’s decision This puts control back in the user’s hands and eliminates the current pain point where agents keep generating after the discussion has effectively concluded.

Risks / Considerations Partial output in context: Interrupted agents may have half-finished responses in their context window. This could affect subsequent response quality. May need a cleanup mechanism in future iterations. Runtime compatibility: Different CLI agent runtimes may handle SIGINT differently. MVP should target the most common runtime first and expand from there. File operation safety: SIGINT during generation (thinking phase) is safe since tool calls (file writes, etc.) are atomic. However, long-running shell commands could be interrupted — this is consistent with manual Ctrl+C behavior.

howold-lab avatar Feb 18 '26 14:02 howold-lab