Skip to content

Every local worker is one named agent of the swarm, never root - #55

Merged
flujo-app merged 1 commit into
mainfrom
worker-identity
Nov 28, 2026
Merged

flujo-app merged 1 commit into
mainfrom
worker-identity

Conversation

@flujo-app

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

Copy link
Copy Markdown
Owner

Part of #52. First of a stack of three: this one, then #56 (worker tools), then #57 (front page and release 0.13.0).

Until now a local worker started without an agentId connected to the board as the supervisor (root), which may claim work under any agent's name. The README's one-minute example did exactly that, so its "team" was one Claude Code with two labels.

What changes

  • A worker is always one named agent of the swarm. startLiteWorker, liteWorkerCommand and factory-lite require an agentId (--agent <id> on the command line). root is refused. startLiteWorker also refuses an agent the swarm does not have, or one that is not ready, before anything starts.
  • Its board connection is always bound (factory-mcp <board> --actor <agentId>), so every claim, hand-in and review goes under that name. A tool argument cannot choose another agent (that was already true for the workflow tools).
  • A task assigned through a workflow is claimed only by its own worker. The plain claim (Factory.claimTask, MCP factory_claim_task, factory claim) now refuses such a task, so the supervisor can no longer take a builder's lease and block it. Plain tasks are claimed as before.

This breaks callers that started workers without an agentId; it ships in 0.13.0.

Tests

New: a worker is always one named agent (codex, claude, flujo; missing, root, invalid); startLiteWorker refuses a missing swarm and an unknown agent; an assigned task cannot be claimed by the supervisor's plain claim or by another agent; a worker's MCP connection does not list or accept factory_claim_task. Existing tests now pass an agentId.

Local checks (Windows and Linux, as in public-sdk.yml)

Commit dcb9b1c (the same files as this branch after rebasing onto main with #54; checked by comparing the git trees), from a clean git -c core.autocrlf=false archive snapshot with a clean npm ci each time. Linux ran in disposable node:*-bookworm-slim Docker containers as the node user.

Platform Node npm audit focused tests Python (Modal, RunPod) packed install, SDK check, CLI help installed MCP tests evidence regressions
Windows v22.17.0 10.9.2 passed 342 passed passed passed 1 passed 7 passed
Windows v24.22.1 11.19.1 passed 342 passed passed passed 1 passed 7 passed
Linux v22.17.0 10.9.2 passed 342 passed passed passed 1 passed 7 passed
Linux v24.22.1 11.19.1 passed 342 passed passed passed 1 passed 7 passed

All four combinations passed.

- startLiteWorker, liteWorkerCommand and factory-lite require an agentId
  (--agent on the command line); root is refused, and startLiteWorker also
  refuses an agent the swarm does not have or one that is not ready.
- The worker's board connection is always launched with --actor, so every
  claim, hand-in and review goes under that name.
- The plain claim (Factory.claimTask, factory_claim_task, factory claim)
  refuses a task assigned through a workflow: only its assigned worker
  claims it, with factory_workflow.
@flujo-app flujo-app added the enhancement New feature or request label Nov 28, 2026
@flujo-app
flujo-app merged commit 152753f into main Nov 28, 2026
2 checks passed
@flujo-app
flujo-app deleted the worker-identity branch November 28, 2026 16:14
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