Replace coord file watchers with peer messaging - #184
Open
astex wants to merge 1 commit into
Open
Conversation
Coordination files were doing double duty as both the durable state record and the wakeup mechanism, via a watch.sh process per file. Peer messaging replaces the wakeup half: the file stays the source of truth, and a one-line SendMessage acts as a doorbell pointing at it. That drops one background process per child, and lets a child log freely during review instead of staying quiet to avoid waking the parent. Addressing works without any new plumbing. A parent lists peers before and after spawn_tab and takes the new row, recording it in the child's coord file as a Session header. Since an agent can't see its own name, the parent bootstraps the reverse direction by sending a hello, which the child answers by copying the from attribute into a Parent session header. The tradeoff is that wakeup is no longer fail-safe: a watcher fires on any write, while a doorbell only rings if the writer remembers, so every skill now treats writing and ringing as a single step. Hand-editing a coord file also no longer wakes the tab; chat is the channel for human input. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
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.
Coordination files were doing double duty as both the durable state record and the wakeup mechanism, via a watch.sh process per file. Peer messaging replaces the wakeup half: the file stays the source of truth, and a one-line SendMessage acts as a doorbell pointing at it. That drops one background process per child, and it lets a child log freely during review instead of staying quiet to avoid waking the parent for nothing.
Addressing works without any new plumbing. A parent lists peers before and after spawn_tab and takes the new row, recording it in the child's coord file as a Session header; in worktree projects the session name is the branch name plus a suffix, which serves as a cross-check. Since an agent can't see its own name, the parent bootstraps the reverse direction by sending a hello, which the child answers by copying the from attribute into a Parent session header.
The tradeoff is that wakeup is no longer fail-safe. A watcher fired on any write; a doorbell only rings if the writer remembers, and there is no timeout behind it. So every skill now states that writing an entry and ringing are a single step, and that a directive nobody rings for is never read. Hand-editing a coord file also no longer wakes the tab, which seems fine given chat is the better channel for human input anyway.
Touches both the git and nogit variants of delegate, work-as-subtask, and implement-iterate, plus GENERATION.md, tournament, and adversarial. watch.sh is deleted, and config.rs now removes the stale copy older installs wrote so no agent can find it and fall back to polling.
🤖 Generated with Claude Code