Show which agent spawned which, from briefs already in the bus #14
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "add-spawn-tree"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Agents spawn agents spawn agents, and herdr renders them flat. After a few hops nobody can say who asked for what, or what a reap would take with it.
--subjectsadds each agent's brief subject, which is usually the answer to "why does this agent exist":No new store
spawnalready delivers every brief as mail from the spawning pane to the new one, so the parent edge has been recorded since the first spawn — nothing had ever read it.spawn_edges()recovers it by finding the briefs (identified bycompose_brief's own footer) and reading each sender. 39 briefs are recoverable from recent history alone.Two properties that matter more than the rendering
A reaped parent does not orphan its children. They re-attach to the nearest ancestor still running, so the tree keeps showing real relationships as intermediate agents come and go.
Pane ids are recycled after a reap, so the recorded graph can close a loop. Walking it terminates instead of hanging, and an agent is never shown as its own parent.
That second half was a real bug, not a hypothetical: the first version returned the starting pane as its own ancestor, and the selftest assertion caught it before it shipped. Newest-brief-per-pane wins for the same reason — an id seen today may belong to a different agent than the one that held it yesterday.
Also: a pane, so it can go on a hotkey
The tree is most useful as a glance rather than a command you stop to type, so the plugin ships it as a popup pane:
Refreshed every 10s rather than herdr-mail's 3s — the genealogy only changes on a spawn or a reap, and each pass costs a bus scan plus an agent list.
The command is
cd "${HERDR_PLUGIN_ROOT:-.}"rather than either alternative alone. A pane's cwd is the plugin root (mail's inbox pane already relies on that), but depending only onHERDR_PLUGIN_ROOTbreaks if herdr doesn't set it for panes, andcd ""exits immediately — and a popup that closes at once is indistinguishable from one that never opened.Checks
spawn selftestcovers label derivation from a worktree path and its fallbacks, re-attachment through a dead parent, and the cycle guard. Verified the cycle gate fails when the guard is removed:Known limit: popups don't appear in
herdr pane listorpane process-info, so the pane's rendering can't be verified from a shell — equally true of the long-standing mail inbox pane. What was verified is the exact command the manifest runs, with and withoutHERDR_PLUGIN_ROOTset.🤖 Generated with Claude Code
`spawn tree` is most useful as a glance, not a command you stop to type, so the plugin now ships it as a popup pane and the skill documents the keybinding. Refreshed every 10s rather than herdr-mail's 3s: the genealogy only changes when an agent is spawned or reaped, and each pass costs a bus scan plus an agent list. Polling three times faster would buy nothing. The command is `cd "${HERDR_PLUGIN_ROOT:-.}"` rather than either alternative on its own. A pane's cwd is the plugin root -- herdr-mail's inbox pane already relies on that -- but depending only on HERDR_PLUGIN_ROOT breaks if herdr does not set it for panes, and `cd ""` exits immediately. A popup that closes at once is indistinguishable from one that never opened, which is a bad failure to debug and an easy one to avoid. Note popups do not appear in `herdr pane list` or `pane process-info`, so the rendering cannot be verified from a shell -- this is equally true of the long-standing mail inbox pane. What was verified is the exact command the manifest runs, with and without HERDR_PLUGIN_ROOT set. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>