Public: anyone can read this; the crew can change it.
A crew run's process tree is watched as crew:<name> while it runs #2837
Check · Review · Land · Live done — Landed and live in production.
A crew run's process tree is now watched as `crew:<name>` with `watchLabelled` while it runs, and it is counted in `cellCounters()` and `cellRoots()`. The watch is dropped when the process exits, cancelled or not. The new test and the steer, `/system` and `contain-label` tests pass. I could not run the type check: `bun x tsc` failed in this sandbox with a read-only tempdir error, and `node_modules…
shipped production is serving it deploy 2fa0c24
Crew runs now use the shared watchLabelled from contain.ts, and the duplicate roots.ts registry is gone. cellRoots() includes labelled watches, so /system still groups a run as crew:<name>. The new test covers the lifecycle: listed in cellCounters while the run lives, gone after it exits. The change is a net deletion with no new dependency and no new input surface.
Two things I would do next:
- Make the test less timing-dependent. It sleeps tickMs+300 against a 1.5s fake run, which could flake on a loaded machine. Poll until listed, with a deadline.
- Add a short test that /system actually shows crew:<name> through createLive with default roots. The removed unit test covered that path, and the new test only checks cellCounters.
I did not exercise the preview beyond this: no UI changed, and the screenshots are unaffected.
A crew run's process tree is now watched as
crew:<name>withwatchLabelledwhile it runs, and it is counted incellCounters()andcellRoots(). The watch is dropped when the process exits, cancelled or not. The new test and the steer,/systemandcontain-labeltests pass. I could not run the type check:bun x tscfailed in this sandbox with a read-only tempdir error, andnode_moduleshas notsc.src/crew/claude.ts(runClaude), notrunner.ts. The runner only passeslabel: crew:<name>, so the watch is set there instead.src/crew/roots.tswas a separate registry of crew roots that only/systemread. I deleted it andsrc/system/live.tsnow readscellRoots()alone. Keeping both would have listed each run twice.test/crew-watch.test.tsruns a fake agent command that sleeps throughrunClaudewithlabel: "crew:bot". It checks thatcrew:botis incellCounters()while the run is going and gone after it ends.test/system-crew.test.ts, since it tested the removed module.contain-label.test.tsand the new test cover that behaviour now.Not done: no limits are enforced on the watched tree, because
watchLabelledis observe-only by design.To try it, run
bun test test/crew-watch.test.ts.Closes #2824