Repository navigation
Interrupt an agent with its correcting message - #116
Merged
Merged
Conversation
agent_send takes a mode instead of the followUp flag: steer, followUp, or interrupt. An interrupt aborts the recipient's work under its turn, drops its queued messages, and sends the message, keeping the job and the agents it spawned. Pi and agents both get it; agents can interrupt whoever they can message, and stopped agents still refuse. An agent's interrupting send records its message together with the interrupt after the abort, so a resumed send never aborts the work its message started. Turns waited on by an aborted caller are given up, so agents that interrupt each other can't deadlock. Calls that set followUp keep working.
An agent's interrupting send aborted its recipient through its own call, so cancelling that call while the recipient wound down skipped the interrupt's watermark. The recipient's group results then restarted it without the correction. The service now aborts and records the watermark for the send, under the recipient's turn, whether or not the sender still waits. A cancelled sender stops waiting at once, so agents interrupting each other still can't deadlock, and logs nothing. Also wait for the projection in the crash replay test instead of reading it before it refreshed.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
🔍 Problem
Messages could only steer an agent's current work or wait for it to finish. Correcting a long-running or stuck agent required stopping it, which also withdrew its job and stopped the agents it spawned.
🛠️ Solution
agent_sendtakesmode: "steer" | "followUp" | "interrupt"(defaultsteer) on both surfaces: Pi's tool and agents' own tool. Agents can interrupt whoever they can message; stopped, missing, and not-yet-started recipients are refused before anything is aborted.followUp: truestill works whenmodeis absent, including in the call-line view.💬 Review
MessagingHub.turnand the ordering abort → watermark → log → submit.followUp.