hermes - 💡(How to fix) Fix [Bug]: Kanban task state can change between dispatch and worker startup — no guard in worker init

Official PRs (…)
ON THIS PAGE

Recommended Tools

×6

Utilities matched from this issue’s tags and category — try them while you read without losing context.

GitHub issue graph ai analysis

Paste a GitHub issue URL. We fetch that issue, discover linked issues from bodies/comments/timeline, collect linked pull requests, and produce a structured English report.

The report is written in English Markdown for sharing and archival.

Helpful · Quick feedback

Loading…

There is a race condition between the kanban dispatcher claiming a task and the worker process actually starting up and reading the task state. During this window, the task can be:

  • Blocked by an operator
  • Archived by an operator
  • Reassigned to a different profile
  • Reclaimed by another dispatcher tick

The worker starts up, calls kanban_show, and gets a task in a state it shouldn't be running in. The kanban-worker skill explicitly warns: "Always kanban_show first. If it reports blocked or archived, stop — you shouldn't be running." But this relies on every worker correctly implementing this check, and there is no enforcement at the framework level.

Root Cause

There is a race condition between the kanban dispatcher claiming a task and the worker process actually starting up and reading the task state. During this window, the task can be:

  • Blocked by an operator
  • Archived by an operator
  • Reassigned to a different profile
  • Reclaimed by another dispatcher tick

The worker starts up, calls kanban_show, and gets a task in a state it shouldn't be running in. The kanban-worker skill explicitly warns: "Always kanban_show first. If it reports blocked or archived, stop — you shouldn't be running." But this relies on every worker correctly implementing this check, and there is no enforcement at the framework level.

Fix Action

Fix / Workaround

There is a race condition between the kanban dispatcher claiming a task and the worker process actually starting up and reading the task state. During this window, the task can be:

  • Blocked by an operator
  • Archived by an operator
  • Reassigned to a different profile
  • Reclaimed by another dispatcher tick
  1. Dispatcher claims task t_xxx and starts spawning a worker
  2. Operator blocks t_xxx via hermes kanban block t_xxx
  3. Worker process starts, reads task — it's blocked
  4. Worker either ignores the block and proceeds, or crashes with confusion
RAW_BUFFERClick to expand / collapse

Summary

There is a race condition between the kanban dispatcher claiming a task and the worker process actually starting up and reading the task state. During this window, the task can be:

  • Blocked by an operator
  • Archived by an operator
  • Reassigned to a different profile
  • Reclaimed by another dispatcher tick

The worker starts up, calls kanban_show, and gets a task in a state it shouldn't be running in. The kanban-worker skill explicitly warns: "Always kanban_show first. If it reports blocked or archived, stop — you shouldn't be running." But this relies on every worker correctly implementing this check, and there is no enforcement at the framework level.

Steps to Reproduce

  1. Dispatcher claims task t_xxx and starts spawning a worker
  2. Operator blocks t_xxx via hermes kanban block t_xxx
  3. Worker process starts, reads task — it's blocked
  4. Worker either ignores the block and proceeds, or crashes with confusion

Expected Behavior

  1. The worker bootstrap code (not the skill, but the framework) should automatically check the task state on startup
  2. If the task is blocked, archived, or reassigned, the framework should exit gracefully — no skill code needed
  3. The dispatcher should verify the task is still in a dispatchable state after the worker process starts but before marking it as running

Suggested Fix

  • Add a state-verification step in the worker bootstrap (in agent/prompt_builder.py or the kanban worker entrypoint)
  • If state is not running or ready, log a warning and exit with a specific exit code that the dispatcher recognizes as "task changed state, not a failure"
  • Do NOT increment consecutive_failures for this exit code — the worker didn't fail, the task just changed

Environment

  • Hermes Agent v2.x
  • Documented in kanban-worker skill under "Pitfalls": "Task state can change between dispatch and your startup"

Vote matrix · Quick signals

Works
Did the solution work? Tap to confirm.
Easy Fix
Was it a quick fix?
Time Saver
Did it save you time?
Blocking
Was it severely blocking?
Common Issue
Are others likely hitting this too?
Flaky / Intermittent
Is it intermittent?
Verified / Reproducible
Can you reproduce it reliably?
Loading…

Still need to ship something?

×6

Another batch ranked right after the header list — different links, same matching logic.

Back to top recommendations

TRENDING

hermes - 💡(How to fix) Fix [Bug]: Kanban task state can change between dispatch and worker startup — no guard in worker init