Run Hermes Agent Kanban cards on external coding agents (Codex, Claude Code, OpenCode) or on plain commands, with Hermes still in charge of every card.
Assign a card to a lane such as wr:codex or wr:tests. The runtime claims it, runs it in the card's Hermes workspace, and records the result on the board. The result can be done, sent to review, blocked, or retried. The runtime doesn't patch Hermes and doesn't replace its orchestrator. It is one more well-behaved worker that follows Hermes' claim, heartbeat and retry rules.
- Why
- Features
- How it works
- Quickstart
- Set up with an AI agent
- Configuration
- Agents
- Outcomes
- Running in production
- Security model
- Troubleshooting
- Development
- Roadmap
- Contributing
- License
Hermes profiles are good at planning and coordinating work. Some cards are better handled
elsewhere: a large refactor by Codex, a UI fix by Claude Code, or a nightly test run by
pytest. Without a runtime you have two options, and both are bad:
- Glue scripts that shell out to agents and poke the board directly. They race
Hermes' dispatcher and leave cards stuck in
running. - A second orchestrator with its own queue. The Kanban board stops being the truth.
The Worker Runtime avoids both. Hermes remains the only lifecycle authority, and external executors plug in as explicit, fail-closed lanes.
| Explicit lanes | Only assignees you list are ever claimed. Hermes' dispatcher skips wr:* assignees because they aren't profiles, so each card has exactly one executor. |
| One adapter, many agents | A single ACP client drives Codex, Claude Code, OpenCode, or any ACP-speaking agent. Per-agent differences come down to a pinned launch command. |
| Deterministic lanes | command lanes run tests, linters, builds or scanners from a trusted argv. |
| Hermes-native failure handling | Each run's supervisor is recorded as the card's worker_pid. Hermes' own crash detection, retry budget, rate-limit cooldown and circuit breaker apply unchanged. |
| Ownership-fenced writes | Every transition carries expected_run_id, so a stale run can never finish a newer one. |
| Whole-tree cancellation | Workers run in their own process group. Reclaims, timeouts and lost claims kill the whole group, and orphans are swept if a supervisor is SIGKILLed. |
| Change evidence | git status is captured before and after each run, and changed files are attached as card metadata. |
| Restart-safe | The runtime keeps no state; the board is the truth. Supervisors are detached, so restarting the daemon never interrupts running work. |
| Least-privilege environment | Children get a minimal env plus only what a lane lists. Secrets are redacted from task logs. |
Hermes Kanban board hermes-worker-runtime
┌────────────────────┐ poll ready wr:* ┌───────────────────────────┐
│ ready wr:codex │ ◀────────────────── │ daemon (one per host) │
│ ready wr:tests │ ── claim (CAS) ───▶ │ per-lane concurrency │
└────────────────────┘ └─────────────┬─────────────┘
▲ spawn, detached; recorded
│ as the card's worker_pid
│ ┌─────────────▼─────────────┐
│ heartbeat · ownership check │ supervisor (one per run) │
├─────────────────────────────── │ timeout · redacted log │
│ └─────────────┬─────────────┘
│ ACP session │ or argv, in the
│ │ Hermes workspace
│ ┌─────────────▼─────────────┐
│ │ Codex · Claude · OpenCode │
│ │ pytest · ruff · make … │
│ └─────────────┬─────────────┘
│ complete / review / block │ normalized
└────── (expected_run_id) or exit code ◀──────┘ result
- Discover. The daemon polls every configured board for
readycards whose assignee matches a lane, respecting each lane'sconcurrency. - Claim. It takes the card through Hermes' own compare-and-swap claim. If two daemons or hosts race for a card, exactly one wins.
- Supervise. A detached supervisor resolves the Hermes workspace and launches the worker. It then heartbeats the claim, re-checks ownership, and enforces the timeout.
- Record. The result is normalized and written back with
expected_run_id. Failures can instead be handed to Hermes' crash accounting as an exit code (see Outcomes).
Design notes, failure-mode tables and the exact Hermes surfaces used are in docs/implementation-plan.md.
Requirements: Hermes Agent ≥ 0.21.4 on macOS or Linux, with its Kanban dispatcher
running (the gateway runs it by default: kanban.dispatch_in_gateway: true). The runtime
claims cards itself, but failed runs are booked, retried and eventually blocked by the
dispatcher's crash sweep, just like Hermes' own workers. For agent lanes you also need the
agent CLI, plus npx for the Codex and Claude presets.
# 1. Install the plugin (also installs PyYAML + agent-client-protocol if missing)
hermes plugins install chryzxc/hermes-worker-runtime --enable
# 2. Configure lanes
cp ~/.hermes/plugins/worker-runtime/examples/worker-runtime.yaml ~/.hermes/worker-runtime.yaml
$EDITOR ~/.hermes/worker-runtime.yaml
# 3. Check the setup
hermes worker-runtime doctor
# 4. Start the daemon
hermes worker-runtime runThen assign work:
hermes kanban create "Fix the flaky login test" --assignee wr:codex
hermes kanban create "Run the full test suite" --assignee wr:testsPrefer to let an agent do it? See Set up with an AI agent.
doctor output looks like this:
hermes kanban : /Users/you/.hermes/hermes-agent/hermes_cli/kanban_db.py
mode : pid-tracked
boards : all
lane tests wr:tests adapter=command concurrency=2 OK
lane codex wr:codex adapter=acp concurrency=1 OK
lane claude wr:claude adapter=acp concurrency=1 OK
| Command | What it does |
|---|---|
hermes worker-runtime doctor |
Validates config, shows the mode, and checks each lane's executor |
hermes worker-runtime lanes |
Prints the validated lane registry as JSON |
hermes worker-runtime tick |
Runs one discovery/claim pass and exits (useful for cron or debugging) |
hermes worker-runtime run |
Runs the daemon in the foreground (one per HERMES_HOME, enforced by lock) |
Each command is also available as python -m hermes_worker_runtime <command>.
hermes plugins update worker-runtime # pull the latest main
hermes plugins install chryzxc/hermes-worker-runtime --force \
--ref <commit-sha> # pin an exact commitRelease commits are listed on the releases page.
For a hackable checkout, clone the repo and symlink it into ~/.hermes/plugins/worker-runtime
instead (see Development).
You can let Hermes (or any coding agent with a shell) do the setup. Paste this prompt:
Install and set up the Hermes Worker Runtime plugin by following the "Agent setup steps" in https://github.com/chryzxc/hermes-worker-runtime/blob/main/README.md. Ask me before any step that says to ask.
These steps are written for an agent. Run them in order and stop at the first check that fails.
- Check the host. Run
hermes --versionandhermes kanban boards list. Hermes must be at least 0.21.4, and the Kanban board must work. Note the output ofcommand -v hermes, and for Codex or Claude lanescommand -v npx. You need both paths in step 6. - Install and enable the plugin.
If Hermes reports a dependency conflict, report it to the user as an issue on this repo. Don't edit Hermes' own dependency pins.
hermes plugins install chryzxc/hermes-worker-runtime --enable hermes plugins list | grep worker-runtime # must say "enabled"
- Ask the user:
- Which lanes to enable:
codex,claude,opencode, and/or command lanes such astests. - Which boards the runtime may claim from (
all, or a list of board slugs). - Whether agents may approve their own tool calls (
permission_policy: allow). The default isdeny, and an agent that can't run tools can't edit files. Don't chooseallowfor the user.
- Which lanes to enable:
- Write the config. Start from
~/.hermes/plugins/worker-runtime/examples/worker-runtime.yamland keep only the lanes the user chose. Write it to$HERMES_HOME/worker-runtime.yaml(default~/.hermes/worker-runtime.yaml). If a file already exists there, show it to the user and ask before replacing it. For acommandlane, use an argv list (never a shell string). Commands run in the card's workspace, so cards for it need--workspace dir:<project path>(orworktree:<repo path>). - Verify. Run
hermes worker-runtime doctor.- It must exit 0, and every lane must say
OK. - In
pid-trackedmode,dispatchermust not sayNOT RUNNING; if it does, start the gateway (hermes gateway start, orhermes gateway runin the foreground). - An agent lane reporting
UNAVAILABLEusually means its CLI isn't logged in (codex login,claude), ornpxisn't onPATH.
- It must exit 0, and every lane must say
- Start the daemon. Ask the user whether to run it now in the foreground
(
hermes worker-runtime run) or to install it as a service that starts at login.- For a service, follow Running in production.
- Use the
hermespath from step 1, not a path inside a Hermes venv. - Put the
npxdirectory from step 1 on the service'sPATH. - Only one daemon may run per
HERMES_HOME; a second one exits with a lock error.
- Smoke-test one lane, then report. Ask the user before running one small card on an
agent lane, because it uses their agent quota. Then create it:
If it ends up
hermes kanban create "Create hello.txt" --assignee wr:codex \ --body "Create a file named hello.txt containing exactly: hi. Change nothing else." hermes kanban show <task-id> # ready → running → review (or done)
blocked, readhermes kanban log <task-id>and see Troubleshooting. When it passes, give the user a short report:- the plugin version;
- the lanes and boards configured;
- how the daemon runs (foreground or service);
- the smoke-test result;
- how to assign work:
--assignee wr:<lane>.
The config file is $HERMES_HOME/worker-runtime.yaml (default
~/.hermes/worker-runtime.yaml). It is validated strictly: an unknown key, a
shell-string command, a malformed assignee or a duplicate lane stops the daemon before it
claims anything.
boards: all # or [default, infra]
poll_interval_seconds: 5
lanes:
tests:
assignee: wr:tests
adapter: command
command: ["uv", "run", "pytest", "-q"]
concurrency: 2
timeout_seconds: 1800
codex:
assignee: wr:codex
adapter: acp
agent: codex
on_success: review # a human signs off on agent work
env:
pass: [OPENAI_API_KEY]
instructions: |
Keep the change minimal. Run the tests before you finish.A fully commented example is in examples/worker-runtime.yaml.
Lane reference
| Key | Default | Meaning |
|---|---|---|
assignee |
required | wr:<name>, lowercase. The only thing that makes a card executable. |
adapter |
required | command or acp |
command |
argv list for command lanes. Shell strings are rejected. |
|
agent |
ACP preset: codex, claude, opencode |
|
agent_command |
Explicit ACP agent argv (for any other agent) | |
concurrency |
1 |
Maximum running cards for this lane |
timeout_seconds |
3600 |
Wall-clock limit per run |
on_success |
complete (command) / review (acp) |
complete or review |
on_failure |
block (command) / fail (acp) |
block: blocked, needs input. fail: exit code goes to Hermes' retry budget. |
reviewer |
Hermes profile to hand reviews to | |
permission_policy |
allow |
How to answer an agent's tool-permission prompts: allow or deny |
env.pass |
[] |
Extra environment variables to forward |
env.set |
{} |
Variables to set for the worker |
instructions |
Appended to the Hermes worker context for agent lanes | |
kill_grace_seconds |
10 |
SIGTERM → SIGKILL grace for the worker's process group |
Global settings
| Key | Default | Meaning |
|---|---|---|
boards |
all |
all (every non-archived board) or a list of board slugs |
poll_interval_seconds |
5 |
How often the daemon looks for ready cards |
heartbeat_interval_seconds |
30 |
Claim heartbeat and ownership check cadence |
worker_heartbeat_interval_seconds |
300 |
Liveness heartbeat for Hermes' stale-worker detection |
claim_ttl_seconds |
Hermes default | Claim TTL used when claiming and heartbeating |
Every worker also receives WR_TASK_ID, WR_RUN_ID, WR_WORKSPACE and WR_LANE.
| Preset | Launches | Authentication |
|---|---|---|
codex |
npx -y @agentclientprotocol/codex-acp@1.13.1 |
codex login, or OPENAI_API_KEY in env.pass |
claude |
npx -y @agentclientprotocol/claude-agent-acp@0.81.2 |
Claude Code login, or ANTHROPIC_API_KEY in env.pass |
opencode |
opencode acp |
OpenCode's own config |
| custom | agent_command: [...] |
Up to the agent |
Presets are pinned, so adapter upgrades are deliberate. The runtime is the ACP client:
- It opens a session rooted at the card's Hermes workspace and sends the Hermes worker
context plus the lane's
instructions. - It streams the agent's messages and tool calls into the Hermes task log.
- It answers permission prompts according to
permission_policy. - It does not offer file-system or terminal capabilities; agents use their own tools.
Agents are asked to finish with a structured block:
```hermes-result
{"status": "success", "summary": "Fixed the race in login retry; added a regression test."}
```
status is one of success, needs_review, blocked or failed. If an agent answers in
prose instead, the card goes to review and is never marked done on faith. Agents never
get Kanban credentials: HERMES_KANBAN_* is stripped from their environment, and only
the runtime writes to the board.
| Worker outcome | On the board |
|---|---|
| Success | done, or review with on_success: review |
Agent says needs_review, or answers in prose |
review |
Agent says blocked, or refuses the task |
blocked (needs input) |
Failed or timed out, with on_failure: block |
blocked (needs input), reason attached |
Failed or timed out, with on_failure: fail |
exit 1: Hermes counts a failure and retries up to its limit |
| Rate limited | exit 75: Hermes requeues after its cooldown without spending the retry budget |
| Auth failure or missing executable | exit 78: Hermes' circuit breaker trips (retrying won't help) |
| Reclaimed, lost claim, or signalled | nothing is written; the worker's process tree is killed |
Every write includes metadata: lane, adapter, status, exit code, duration, changed files
and (for commands) the output tail. The full redacted transcript goes to the card's Hermes
worker log, hermes kanban log <id>.
Modes. Recording the supervisor as the card's
worker_piduses one private Hermes helper. If a future Hermes drops it, the runtime switches to claim-only mode: failures are written as blocks and dead supervisors are recovered by claim TTL.doctorshows which mode is active.
Run one daemon per host. Several hosts can share a board safely, because claims are compare-and-swap.
macOS (launchd): edit and load examples/com.hermes.worker-runtime.plist:
cp examples/com.hermes.worker-runtime.plist ~/Library/LaunchAgents/
launchctl load ~/Library/LaunchAgents/com.hermes.worker-runtime.plistLinux (systemd user unit): use examples/hermes-worker-runtime.service:
cp examples/hermes-worker-runtime.service ~/.config/systemd/user/
systemctl --user enable --now hermes-worker-runtimeOperational notes
- Keep the Hermes gateway (or another Kanban dispatcher) running. Without it, a failed run
stays
runningbecause nothing books the supervisor's exit code.doctorwarns about this. - Restarting the daemon is safe: supervisors run in their own sessions and keep going.
hermes kanban reclaim <id>works as usual. The supervisor receives SIGTERM, kills the worker's process tree within 3 s, and exits without writing to the card.- The daemon's own log goes to stdout/stderr (see the unit files). Per-card logs live in Hermes' worker logs.
- Runtime files (
daemon.lockand per-run pid files) live in$HERMES_HOME/worker-runtime/.
- Commands come only from config. Card titles and bodies never reach an argv, and shell strings are rejected.
- Minimal environment. Children receive
PATH HOME USER LOGNAME SHELL LANG LC_ALL TERM TMPDIR, plus whatever the lane lists inenv.passandenv.set.HERMES_KANBAN_*is never forwarded, even if listed. - Redaction. Log lines are scrubbed of the values of secret-named variables (
*KEY*,*TOKEN*,*SECRET*, …) and of token-shaped strings (sk-…,ghp_…,xox…,AKIA…, JWTs, bearer tokens). - The runtime owns the lifecycle. Agents can't move cards; transitions are fenced by
expected_run_id. - Fail closed. Invalid config, an unknown assignee or an unavailable executor never results in a guessed execution.
Report vulnerabilities as described in SECURITY.md.
A wr:* card stays in ready
- Is the daemon running?
hermes worker-runtime tickshows what a single pass would claim. - Does the assignee exactly match a lane? Check
hermes worker-runtime lanes. Assignees are lowercase. - Is the lane at its
concurrencylimit?ticklists capped cards. - Is the card on a board you configured under
boards?
A card stays in running after its worker finished
In pid-tracked mode a failed run ends with the supervisor exiting non-zero, and the
Hermes dispatcher's crash sweep moves the card on: it retries it, or blocks it once
kanban.failure_limit is reached. Check that doctor shows the dispatcher as running;
the sweep runs on the gateway's kanban.dispatch_interval_seconds tick. The card's
worker log (hermes kanban log <id>) ends with [kanban-worker-exit] rc=<code>.
Cards get blocked with "unavailable"
The executor couldn't start or authenticate. Run hermes worker-runtime doctor, and
check that the agent CLI is logged in as the user the daemon runs as. Any API-key
variables must be listed in the lane's env.pass, because nothing is inherited implicitly.
An agent finished but the card went to review, not done
The agent didn't end with a hermes-result block, so the runtime refused to guess. Add a
reminder to the lane's instructions, or accept the review step. It's the safe default
for agent lanes.
doctor reports claim-only mode
Your Hermes version doesn't expose the helper used to record the supervisor as the card's
worker. Everything still works, but failures are recorded as blocks instead of flowing
through Hermes' retry budget. Upgrading Hermes restores pid-tracked mode.
git clone https://github.com/chryzxc/hermes-worker-runtime && cd hermes-worker-runtime
# Use the checkout as your installed plugin (edits take effect on the next run)
ln -sfn "$PWD" ~/.hermes/plugins/worker-runtime
hermes plugins enable worker-runtime
# Unit tests only (no Hermes needed)
HERMES_AGENT_ROOT=/nonexistent uv run --no-project --with pytest --with pyyaml \
--with 'agent-client-protocol>=0.9,<0.10' python -m pytest
# Full suite against your local Hermes install (spawns real supervisors)
~/.hermes/hermes-agent/venv/bin/python -m pip install --target .pytest-lib pytest
PYTHONPATH=.pytest-lib ~/.hermes/hermes-agent/venv/bin/python -m pytestThe integration tests run against the real Hermes kanban kernel in a throwaway
HERMES_HOME. They spawn real supervisors and use a scriptable fake ACP agent,
tests/fake_acp_agent.py. CI runs unit tests on Python
3.11–3.13, and the full suite on Ubuntu and macOS against a pinned Hermes commit.
hermes_worker_runtime/
├── hermes_api.py # the only module that imports Hermes
├── config.py # fail-closed lane registry
├── scheduler.py # discovery, claim, supervisor spawn, orphan sweep
├── supervisor.py # one run: workspace, heartbeats, timeout, lifecycle write
├── lifecycle.py # normalized result → Hermes transition / exit code
├── adapters/ # command.py, acp.py
├── envpolicy.py # child env + redaction
└── result.py # result model + hermes-result parsing
See CHANGELOG.md for release history.
- Command lanes, lifecycle mapping, fail-closed config
- Generic ACP adapter with Codex, Claude Code and OpenCode presets
- Reliability: daemon lock, process-group cancellation, orphan sweeping, rate-limit and auth classification
- Live validation against Codex, Claude Code and OpenCode, plus a soak test
- Wake on
on_kanban_dispatch_tickinstead of polling - Upstream a public
record_worker_pid()API to Hermes - Remote and container lanes
Issues and pull requests are welcome. Before opening a PR, run the full test suite (see Development); CI must pass on both Ubuntu and macOS. Report security issues privately, as described in SECURITY.md.
MIT © Christian Rey Villablanca