Skip to content

The whole team in herdr: agent-started workers and Docker or cloud fleets; release 0.15.0 - #60

Merged
flujo-app merged 4 commits into
mainfrom
herdr-teams-and-fleets
Nov 29, 2026
Merged

flujo-app merged 4 commits into
mainfrom
herdr-teams-and-fleets

Conversation

@flujo-app

Copy link
Copy Markdown
Owner

Steps 1b and 3 of #51: the rest of a FACTORY team shows up in herdr, not only workers you start yourself in a pane.

What you get

Workers your agent starts. When the process that starts a worker (factory_start_worker, or factory.workers.start) runs inside a herdr pane, each worker gets a pane of its own in a FACTORY team tab. The pane runs factory-herdr worker <board> <agent>, which prints what the worker does, step by step. It also tells herdr the worker's state:

  • working while a turn runs
  • idle while it waits for the board
  • needs you when its run failed or vanished, with the reason

The name (FACTORY · builder), title and job text work as in #58. factory-herdr team <board> opens the panes for workers started outside herdr, for example from a Codex supervisor, since Codex passes its MCP servers only a few settings. herdr: false turns it off.

Docker and cloud fleets. factory-herdr fleet <fleet folder> run in a herdr pane opens one tab per machine and one pane per agent:

  • Each pane shows that agent's steps: joined the fleet, started a turn, used a tool, said something, finished its turn, its job.
  • herdr's sidebar shows the agent as working, idle or needs-you, with its job from the fleet's board or claims.
  • It reads the fleet folder, which fleet.observe() / fleet.supervise() keep current, or asks the fleet itself with --observe docker|cloud|sprites.
  • Ctrl+C or q stops it and hands the agents back to herdr. Started again, it reuses its panes and writes nothing twice.

How it works. It uses only herdr's documented commands:

  • tab create, pane split and pane run open the panes. The command is quoted for the pane's own shell (PowerShell, cmd or POSIX), as reported by pane process-info.
  • pane report-agent (source factory:follow, agent factory) and report-metadata report each agent. A worker or fleet agent has no program of its own in the pane that herdr could recognize.

New files: src/herdr-panes.mjs, src/herdr-follow.mjs, and bin/factory-herdr.mjs (a new factory-herdr command). LocalWorkers.start opens the pane. README and guide updated. The SDK exports showWorkerInHerdr, followWorker, followFleet, workerView, fleetAgentView and fleetActivity.

Checks

Tests: test/herdr-follow.test.mjs, 10 tests, added to public-sdk.yml. They use a stand-in herdr that answers with herdr's JSON shapes and cover:

  • quoting per shell
  • one tab per group with split panes, keeping a live pane and replacing a closed one
  • the reporter sending only changes, in rising order, and releasing
  • worker and fleet state mapping, and readable fleet steps
  • a worker pane's output and reports
  • LocalWorkers.start opening a pane inside herdr, and none outside
  • a fleet follower restarted without duplicates
  • the CLI refusing to work outside herdr

Local CI, on e45aaf2: each run used a clean LF snapshot, as in public-sdk.yml (npm ci, production audit, the focused list through the temp guard, both Python suites, a fresh install of the packed package including factory-herdr --help and the installed MCP tests, evidence regressions).

Platform Node / npm Focused tests Package MCP tests Evidence
Windows 10 22.17.0 / 10.9.2 369 of 369 2 of 2 7 of 7
Windows 10 24.22.1 / 11.19.1 369 of 369 2 of 2 7 of 7
Linux (Docker bookworm-slim) 22.17.0 / 10.9.2 369 of 369 2 of 2 7 of 7
Linux (Docker bookworm-slim) 24.22.1 / 11.19.1 369 of 369 2 of 2 7 of 7

Real runs, herdr 0.9.5 on Windows 10, in its own named session:

  • Claude Code passes herdr's settings to MCP servers. Checked with claude -p and a small MCP server that records its HERDR_* settings.
  • Agent-started workers. From a herdr pane, factory.workers.start started a real two-worker team: builder and reviewer, Claude Code on Haiku, in the background.
    • Both got panes in a FACTORY team tab. The panes showed each step, from "used Write" and "used mcp__factory__factory_submit_workspace" to "finished: nothing assigned to it is left open".
    • The sidebar went from working ("reviewing page", title "page: Write hello.html…") to done ("finished · nothing assigned to it is left open").
    • The task ended accepted.
  • Docker fleet. scripts/docker-fleet-smoke.mjs --program claude --teams --machines 2 --agents 2 --prebuild --quick passed every step, while factory-herdr fleet followed it from a herdr pane.
    • All four agents appeared, one tab per machine.
    • The two leads went idle → working → done.
    • Each agent's job came from the board's claims ("took docker-smoke-…-m0-a1").
  • Two bugs found in that run and fixed here:
    • Raw runtime events and an "[object Object]" in the fleet panes.
    • Ctrl+C sent through herdr reaches no Node program as a signal on Windows: the same happened with a bare test script. The followers now read their own keys. Checked again: Ctrl+C stopped the fleet follower, and all four agents were handed back.

This PR is also release 0.15.0 (version and install lines). Not run live: a Fly.io or Sprites fleet. It uses the same folder-reading path as Docker, and --observe cloud|sprites only picks the fleet class.

Not in this PR

Refs #51

Workers your agent starts in the background (factory_start_worker,
factory.workers.start) now get a herdr pane of their own when the starting
process runs in herdr: a "FACTORY team" tab, one pane per worker, each running
`factory-herdr worker`, which prints what the worker does and reports it to
herdr as FACTORY · <agent> (working while a turn runs, idle while it waits,
needs you when its run failed), with its job.

`factory-herdr fleet <fleet folder>` does the same for Docker, Fly.io and
Sprites fleets: one tab per machine, one pane per agent, from the fleet's
status report and activity traces (or asking the fleet itself with --observe).
`factory-herdr team <board>` opens the panes for workers started elsewhere.

Panes are opened with herdr's own tab create / pane split / pane run, quoted
for the pane's shell, and reported with report-agent and report-metadata.

Refs #51
Found in a real Docker fleet of Claude Code agents shown in herdr:
- A fleet agent's pane showed the runtime's raw events (item/completed,
  thread/tokenUsage/updated, "[object Object]"). It now shows what the agent
  did (said, used a tool, ran a command, started or finished a turn) and
  leaves the bookkeeping out.
- Ctrl+C typed into a herdr pane on Windows reaches no Node program as a
  signal, so the follower never stopped or handed its agents back. The
  followers now read their own keys: Ctrl+C or q stops them, everywhere.

Refs #51
…stem

Found by local CI on Linux: a PowerShell path with backslashes was not recognized there, so the command got POSIX quoting. Shell names are now split on both separators, as herdr itself does.

Refs #51
Version 0.15.0 in package.json and package-lock.json; the guide's install lines point to v0.15.0 and say what is new.
@flujo-app flujo-app added the enhancement New feature or request label Nov 29, 2026
@flujo-app
flujo-app merged commit 0cd51e4 into main Nov 29, 2026
2 checks passed
@flujo-app flujo-app mentioned this pull request Nov 29, 2026
3 of 4 tasks
@flujo-app
flujo-app deleted the herdr-teams-and-fleets branch November 29, 2026 20:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant