Skip to content

Workers started in a herdr pane show their agent and job in herdr's sidebar - #58

Merged
flujo-app merged 2 commits into
mainfrom
herdr-agent-labels
Nov 29, 2026
Merged

flujo-app merged 2 commits into
mainfrom
herdr-agent-labels

Conversation

@flujo-app

@flujo-app flujo-app commented Nov 29, 2026 •

Copy link
Copy Markdown
Owner

Step 1 of #51: a swarm's workers show up in herdr.

What you see

Start factory-lite claude … or factory-lite codex … in a herdr pane. In herdr's sidebar the worker now reads FACTORY · builder instead of plain "Claude". The pane title is the job, for example "page: Write the landing page". The text next to the state follows the board:

  • next: page when the job is waiting for the worker
  • building page after the worker claims it
  • fixing page when a review sends it back
  • reviewing menu for a reviewer

When the session ends, all of it goes. Outside herdr nothing changes.

How it works

  • herdr publishes an official way for any program in a pane to label that pane ("Add Herdr support to your agent"). No change to herdr is needed, and herdr does not take outside PRs anyway.
  • factory-lite hands its board server herdr's four HERDR_* settings plus which program it is. It does this only for sessions in a terminal, so background workers from factory_start_worker never label the pane that started them. Codex gives its servers only a few settings of its own, so these are passed explicitly, for both programs.
  • The worker's board server runs herdr pane report-metadata … --source factory:worker --agent claude|codex:
    • at start, after each board call, and every 15 seconds (another agent's review can send work back)
    • only when something changed, and again every 12 hours (herdr drops labels after a day)
  • The label is display-only, guarded with --agent. herdr's own Claude Code and Codex support keeps deciding whether the agent is working, waiting or needs you.
  • Two values are also available for custom herdr layouts: $factory_agent and $factory_job.
  • herdr can never hold a worker up. Reports run in the background and only the newest waiting one is sent. Each carries a rising --seq. Failures are ignored, and a stuck herdr is killed after 3 seconds.
  • When the session ends, startLiteWorker clears everything FACTORY put on the pane.

New: src/herdr.mjs. Changed: src/lite-worker.mjs, bin/factory-mcp.mjs, PUBLIC_SDK.md ("Seeing your workers in herdr"), README.md (one line), and the workflow's test list.

Checks

New tests (test/herdr.test.mjs, 8 tests, added to public-sdk.yml):

  • Nothing happens outside herdr.
  • Only herdr's settings reach the board server, and never for a worker with no terminal.
  • Which job is shown, label text and limits.
  • Newest-first, rising-order sending.
  • A failing or stuck herdr.
  • The label is cleared when the session ends.
  • A real board server labelling a stand-in herdr while the job is assigned and claimed. Root and background workers never label.

Local CI, matching public-sdk.yml. Each run used a clean git -c core.autocrlf=false archive snapshot of 0482943 and ran: npm ci, npm audit --omit=dev --audit-level=high, the focused test list through scripts/test-temp-guard.mjs, both Python suites, npm pack with a fresh install of the package (verify script, CLI help, installed MCP stdio tests), and the evidence regressions.

Platform Node / npm Focused tests Package MCP tests Evidence Audit, Python
Windows 10 22.17.0 / 10.9.2 359 of 359 2 of 2 7 of 7 ok
Windows 10 24.22.1 / 11.19.1 359 of 359 2 of 2 7 of 7 ok
Linux (Docker node:22.17.0-bookworm-slim) 22.17.0 / 10.9.2 359 of 359 2 of 2 7 of 7 ok
Linux (Docker node:24.22.1-bookworm-slim) 24.22.1 / 11.19.1 359 of 359 2 of 2 7 of 7 ok

On Windows, Windows' own tar.exe has to come first on the path, as the workflow's runners have it. With Git's tar, five archive tests fail for reasons unrelated to this change.

Real herdr 0.9.5 (the official release files from herdrdev/herdr):

  • Linux container. factory-lite claude ran in a herdr pane, with a stand-in for Claude Code started under the name claude so herdr recognizes it. Running herdr agent list showed:
    • after start: agent claude, display_agent "FACTORY · builder", title "page: Write the landing page", state labels idle "idle · next: page" / working "next: page", tokens factory_agent=builder, factory_job=next: page
    • after the claim: "building page"
    • after the session ended: no label and no tokens; herdr no longer lists the agent
  • Windows 10 (herdr.exe, own named session). The same flow through the real startLiteWorker. The tokens appeared, changed to "building page" after the claim, and were cleared when the session ended. The name and state text need herdr to recognize Claude Code, and a Windows stand-in cannot pass for claude.exe. The Linux run covers that part.

Real Claude Code 2.1.289 in herdr 0.9.5 on a clean Windows Server 2025 VM: name, title, state text and job values shown, then cleared on /exit (see the comment below). Not run: a real Codex session.

Not in this PR

  • FLUJO workers (step 2)
  • Docker and cloud fleets (step 3)
  • A swarm summary on the herdr workspace

Refs #51

…idebar

A factory-lite claude or codex worker started inside a herdr pane now appears in
herdr's sidebar as "FACTORY · <agent>", with the job it is on (building, fixing,
reviewing or next). It uses herdr's own display-only labels, so herdr keeps
deciding whether the agent is working, waiting or needs you.

- factory-lite hands its board server herdr's four HERDR_* settings, and only
  for sessions in a terminal; background workers never label a pane.
- The worker's board server labels the pane at start, after each board call and
  every 15 seconds, sending only changes, newest first, with rising numbers.
- The label is removed when the session ends; outside herdr nothing happens,
  and a missing, failing or stuck herdr never holds a worker up.

Refs #51
@flujo-app flujo-app added the enhancement New feature or request label Nov 29, 2026
@flujo-app flujo-app mentioned this pull request Nov 29, 2026
3 of 4 tasks
@flujo-app

Copy link
Copy Markdown
Owner Author

Checked on a clean Windows VM with a real Claude Code session

Machine: the local Hyper-V VM flujo-ci-win (Windows Server 2025, restored to its clean checkpoint before and after). Branch at 0482943, cloned from GitHub. herdr 0.9.5 from its official release. Claude Code 2.1.289.

Real worker in herdr. I ran factory-lite claude D:\board\board.sqlite --agent builder "<call factory_workflow next, then claim page>" in a herdr pane. Claude Code called the board twice and replied DONE. Then herdr agent list / herdr pane get showed:

  • agent claude, status idle
  • display name FACTORY · builder
  • title "page: Write the landing page"
  • state labels: working "building page", idle "idle · building page"
  • tokens factory_agent=builder, factory_job=building page

After /exit, the pane had no agent, label or tokens, and herdr agent list was empty.

Tests in the VM (focused list from public-sdk.yml):

  • Node 22.23.4 (npm ci 94 packages): 351 of 359 passed.
  • Node 24.22.1: the same.
  • All 8 herdr tests passed on both.
  • The 8 failures are the RunPod self-hosting tests, which start Python. The VM only has Windows' placeholder python.exe, which opens the Store. GitHub's runners and this PC have real Python, and there those tests pass (359 of 359 above).

Found on the way. herdr's panes on Windows start with the user's normal Windows settings, not the herdr server's. A worker therefore needs node, claude and its login set in the user's own environment or in the pane, which is the same as for any program run in herdr. Nothing in this PR depends on the server's settings.

Explains how a factory-lite worker started in a herdr pane shows up with
its team name and current job, and says plainly that workers your agent
starts in the background have no pane yet, so they don't show up.

Refs #51
@flujo-app

Copy link
Copy Markdown
Owner Author

README section added (2e738ff): "Watch your team in herdr". It says plainly that only workers you start yourself in a pane show up, not the ones your agent starts in the background. Local CI on 2e738ff, clean LF snapshot: Windows 10 and Linux (Docker bookworm-slim), Node 22.17.0 and 24.22.1. Each had 359 of 359 focused tests, 2 of 2 installed-package MCP tests, 7 of 7 evidence tests, audit and both Python suites passing.

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