Skip to content

[Bug]: Tasks created with --initial-status blocked auto-promote to ready ~1s later with no actor — human approval gate bypassed #39609

Closed

Description

@bill3wits

Bug Description

A kanban task created with --initial-status blocked is automatically promoted to
ready roughly 1 second after creation, with no actor recorded on the
transition and no operator action. The task is then claimed and executed by the
default worker.

In our deployment, blocked is used as a human approval gate: an automated
maintenance pipeline files recommended mutations as blocked tasks, and a human is
supposed to be the only thing that moves them to ready (authorization = execution).
Because blocked tasks self-promote, that gate is bypassed entirely. On 2026-06-04 this
caused un-reviewed mutations to execute on a production host with no human in the
loop
. The concrete damage: a task body ran uv pip install pytest==2.7.0, which
downgraded pytest to 2.7.0 in the live service venv at 23:32:52 and left it unable
to import (py 1.11.0 too old). A second un-reviewed task ran a Hermes "promotion"
against the live install. Neither was ever authorized.

This appears related to the guarantee in #24699 (closing comment / PR #28712),
which states that worker-initiated blocks are NOT auto-promoted and remain blocked
until an operator moves them
. That guarantee appears to hold for worker-initiated
blocks
, but is bypassed for tasks created directly in the blocked state via
--initial-status blocked: those are auto-promoted within ~1s.

Steps to Reproduce

  1. Ensure the dashboard service is running (hermes dashboard), gateway dispatch may
    be off (kanban.dispatch_in_gateway: false).
  2. Create a task already in the blocked state:
    hermes kanban create "ASSENT: example gated action" --initial-status blocked
    
  3. Immediately watch the task's events:
    hermes kanban show <task_id>          # or: hermes kanban tail <task_id>
    
  4. Observe a promoted event ~1 second after created, with no operator unblock and
    no actor in the event payload, followed by the worker claiming and running the task.

Expected Behavior

A task created with --initial-status blocked stays blocked until an explicit,
attributed
operator action (dashboard unblock / kanban unblock) moves it to
ready — matching the #24699 / PR #28712 guarantee for worker-initiated blocks. Every
status transition should record the actor that performed it.

Actual Behavior

The task is auto-promoted blocked → ready ~1s after creation, with an empty event
payload (no actor), then claimed and run by the default worker. The run completes in 0s
with no claim/started lifecycle event and no command log, marking the task done
(including one whose own summary reports the action failed).

Affected Component

Other

Messaging Platform (if gateway-related)

No response

Debug Report

⚠️  This will upload the following to a public paste service:
  • System info (OS, Python version, Hermes version, provider, which API keys
    are configured — NOT the actual keys)
  • Recent log lines (agent.log, errors.log, gateway.log, desktop.log — may
    contain conversation fragments and file paths)
  • Full agent.log, gateway.log, and desktop.log (up to 512 KB each — likely
    contains conversation content, tool outputs, and file paths)

Pastes auto-delete after 6 hours.

Collecting debug report...
Uploading...

Debug report uploaded:
  Report       https://paste.rs/UcvMs
  agent.log    https://dpaste.com/8UGEV9PSZ
  gateway.log  https://dpaste.com/8FJB3EURT

⏱  Pastes will auto-delete in 6 hours.
To delete now:  hermes debug delete <url>

Share these links with the Hermes team for support.

Operating System

Ubuntu 26.04

Python Version

3.12.13 (service venv: ~/.hermes/hermes-agent/.venv)

Hermes Version

git commit 0401176c7 (0401176c7ace2f1a76474fa8d0f3899d24c10102), branch main

Additional Logs / Traceback (optional)

### Evidence — verbatim `task_events` rows (SQLite kanban.db)


task_id     ts (local)           kind       payload
----------  -------------------  ---------  -------------------------------------------------
t_e89520e8  2026-06-04 23:30:08  created    {"assignee":"default","status":"blocked", ...}
t_e89520e8  2026-06-04 23:30:09  promoted   (empty payload — no actor)
t_e89520e8  2026-06-04 23:32:44  completed  {"result_len":0,"summary":"Promotion to 96cd37e21 completed. ..."}

t_fcac06bc  2026-06-04 23:30:09  created    {"assignee":"default","status":"blocked", ...}
t_fcac06bc  2026-06-04 23:30:09  promoted   (empty payload — no actor)
t_fcac06bc  2026-06-04 23:33:04  completed  {"result_len":0,"summary":"pytest==2.7.0 install succeeded but import fails. ..."}


- Distinct event kinds for both tasks: `created`, `promoted`, `completed` — **no
  `claimed`/`started`/`running` event** was recorded. `hermes kanban show` reports each
  run as `@default 0s` (`#101`, `#102`); `hermes kanban log <id>` returns no command log.
- **The dispatcher's own counter reported `promoted=0`.** The gateway dispatch loop that
  emits these counters logged, at 23:32:38 on the incident night:
  `gateway.run: kanban dispatcher: disabled via config kanban.dispatch_in_gateway=false`,
  and every nearby counter line shows `... promoted=0 auto_blocked=0`. So the documented
  dispatch loop was **disabled and recorded zero promotions**, yet the tasks were promoted
  anyway — meaning the promote originates from a **separate loop** that does not attribute
  the transition.

### Locus

The locus **appears to be the dispatch loop in the dashboard service**. Supporting
observation: the gateway dispatcher was disabled via `kanban.dispatch_in_gateway=false`
and reported `promoted=0`, ruling it out; the only other long-running process holding
the kanban DB open and writing to it on this box is `hermes dashboard --tui`. The
promote fires ~1s after creation regardless of the gateway dispatcher being off. (Stated
as the apparent locus, not a confirmed code path.)

## Affected Component

Kanban — task lifecycle / auto-promote of `blocked` tasks (apparent locus: dashboard
service dispatch loop). Related: #24699 / PR #28712.

## OS

Ubuntu 26.04 LTS (Resolute Raccoon); kernel 7.0.0-22-generic x86_64

## Python Version

3.12.13 (service venv: `~/.hermes/hermes-agent/.venv`)

## Hermes Version

git commit `0401176c7` (`0401176c7ace2f1a76474fa8d0f3899d24c10102`), branch `main`

Root Cause Analysis (optional)

Notes for maintainers

  • Severity is elevated because blocked is being relied on as a security/authorization
    gate; auto-promotion turns "file for human review" into "execute immediately."
  • Two distinct defects observed: (1) the unattributed blocked → ready auto-promote
    (this issue), and (2) the worker marking a task done with a 0s run, no
    claim/started/command-log evidence, and even when its own summary reports failure —
    worth a separate issue if not already covered.

Proposed Fix (optional)

No response

Are you willing to submit a PR for this?

  • I'd like to fix this myself and submit a PR

Activity

  1. bill3wits commented on Jun 5, 2026

    @bill3wits
    Author

    Related: #28712 reports the same unattributed auto-promote for worker-blocked tasks; this issue shows it also fires on creation-blocked tasks. The unblock-event guard proposed there would close both.

  2. added
    type/bugSomething isn't working
    P3Low — cosmetic, nice to have
    comp/pluginsPlugin system and bundled plugins
    on Jun 5, 2026
  3. dctr commented on Jun 14, 2026

    @dctr

    I can reproduce this on Hermes Agent v0.16.0 (2026.6.5). This is currently a big issue for me. I have bash scripts and LLM tasks creating cards for me that I want human approval (i.e. unblocking) before execution.

    My contract is

    • collectors create cards as blocked
    • user approves by manually transition to ready
    • only then should a worker run

    Observed behaviour is that the card can be auto-promoted and picked up before approval.

  4. dctr commented on Jun 17, 2026

    @dctr

    Regarding the "related" #28712 :

    #28712’s fix does not fix the --initial-status blocked case.

    What it fixes:

    • A task that becomes blocked via kanban_block / hermes kanban block
    • That path emits a blocked event
    • _has_sticky_block() sees that event and prevents auto-promotion

    What it does not fix:

    • A task created directly with --initial-status blocked
    • That path sets status='blocked', but does not emit a sticky blocked event
    • recompute_ready() still promotes it

    Local verification on current Hermes:

    Hermes Agent v0.16.0 (2026.6.5) · upstream 36ae9584
    
    explicit_block_before= blocked
    explicit_block_after_dispatch= blocked
    
    initial_blocked_before= blocked
    initial_blocked_after_dispatch= ready
    dispatch_initial promoted=1
    

    So:

    • hermes kanban block <id> ... works as expected.
    • hermes kanban create ... --initial-status blocked still does not.
  5. pixel4039 commented on Jul 13, 2026

    @pixel4039

    Confirmed still reproducible on a newer build, with a real approval-gate bypass that spawned a writer before its execution contract was attached.

    Environment

    • Hermes Agent v0.18.0 (2026.7.1)
    • Reported upstream marker: e4ea0a0e
    • Local source HEAD: 6ceb21be (carried local commits; the affected lifecycle code matches the root cause described in this issue)
    • Python 3.11.15
    • Ubuntu/Linux

    Real incident (2026-07-13 CST)

    A task was created with --initial-status blocked, an assigned worker profile, and a worktree. The intended sequence was: create blocked card → attach and validate a closed-world execution contract → explicitly unblock/dispatch.

    Observed task events:

    17:42:05  created   payload.status="blocked"
    17:42:58  promoted  payload=null
    17:42:58  claimed   run_id=20
    17:42:58  spawned   worker profile=deepseekpro, pid recorded
    17:45:23  contract-pointer comment attached (too late)
    

    The worker had already modified two files in the isolated worktree before it was terminated. The run was invalidated, its diff preserved locally for audit, and the worktree reset. This confirms the bug is not merely a UI/status inconsistency: it can launch a write-capable worker before an explicit approval gate is released.

    Deterministic temp-DB reproduction

    Against the current source, without a dashboard or live board:

    from hermes_cli import kanban_db as kb
    
    conn = kb.connect(db_path=temp_db)
    tid = kb.create_task(
        conn,
        title="contract gate repro",
        assignee="deepseekpro",
        initial_status="blocked",
    )
    print(kb.get_task(conn, tid).status)  # blocked
    print(kb.recompute_ready(conn))       # 1
    print(kb.get_task(conn, tid).status)  # ready

    Observed output:

    {'before': 'blocked', 'promoted_count': 1, 'after': 'ready',
     'events': ['created', 'promoted']}
    

    Root cause confirmed in current source

    The diagnosis already discussed above is exact:

    1. create_task(initial_status="blocked") stores task_status = "blocked", but appends only a created event.
    2. _has_sticky_block() looks only for the latest blocked/unblocked event, so the newly created task is not considered sticky.
    3. recompute_ready() scans both todo and blocked; for a task with no parents, all([]) is true, so it writes status='ready' and appends an unattributed promoted event.
    4. The dispatcher then legitimately claims/spawns the assigned profile.

    Both proposed fixes remain open as of this confirmation: #34735 and #46565.

    Given that this bypassed a deliberate contract/approval gate and started a write-capable worker, I recommend re-triaging this above P3. The narrow acceptance criterion remains: a task created with initial_status="blocked" must emit/use the same sticky-block semantics as an explicit operator block and must not become runnable until an attributed explicit unblock.

  6. added
    comp/cronCron scheduler and job management
    P2Medium — degraded but workaround exists
    sweeper:risk-session-stateSweeper risk: may lose/corrupt/mis-associate session or context state
    and removed
    comp/pluginsPlugin system and bundled plugins
    P3Low — cosmetic, nice to have
    on Jul 13, 2026
  7. powoct commented on Jul 24, 2026

    @powoct

    Still present on current main (a61183b5, 2026-07-24): create_task() in hermes_cli/kanban_db.py appends only a created event for initial_status="blocked", so _has_sticky_block() has nothing to latch onto — exactly the gap @dctr traced above. Also hit this on v0.19.0 (2026.7.20) in a Docker deployment; a one-transaction fix (emit a blocked event alongside created) has been running clean for us since 2026-07-23 against this regression matrix: created-blocked survives repeated recompute_ready(); explicit unblock releases; circuit-breaker (non-sticky) blocks still auto-recover; idempotent create doesn't double-emit.

    For maintainers: there are already six open PRs implementing this direction (#46565, #34735, #39832, #41497, #64830, #35832), plus #47777 proposing the same fix and awaiting a design steer. Is one of them the canonical candidate to review/salvage? Happy to contribute test coverage there rather than opening a seventh.

  8. added
    needs-decisionAwaiting maintainer decision before any implementation
    and removed
    sweeper:risk-session-stateSweeper risk: may lose/corrupt/mis-associate session or context state
    on Jul 24, 2026
  9. 7 remaining items

  10. lukuku-git commented on Aug 20, 2026

    @lukuku-git

    Confirmed on the current implementation:

    • kanban_db.py:4171 includes blocked tasks as promotion candidates.
    • kanban_db.py:4128 sticky-block detection does not recognize created(status=blocked).
    • Result: a task created with --initial-status blocked can be promoted and executed automatically.

    The safer fix is to remove blocked from promotion candidates. An alternative is to make sticky-block detection recognize created.payload.status == "blocked", but that leaves more room for another promotion path to bypass the intent. blocked -> ready should only be performed by unblock_task.

    State labeling and execution prevention must not be treated as the same thing. A structural execution prohibition enforced at the claim path is required.

  11. ojlapp8-hash commented on Aug 27, 2026

    @ojlapp8-hash

    Fresh real-world reproduction (2026-08-27) confirming this bug + one broader finding. Reported on behalf of operator Jim Lappan II.

    Context

    Multi-agent kanban workflow on Hermes desktop (Windows), orchestrator + specialist profiles (androiddev, dataeng, research, hrbot, graphschema) via the gateway dispatcher (dispatch_in_gateway: true, 60s tick). Human-in-the-loop is a hard requirement — no card should run without operator approval.

    Reproduction

    1. Created cards TB-B6 and TB-B7 with explicit instructions in the body: 'HOLD', 'do not dispatch until Jim approves'.
    2. Cards were created in status ready. The gateway dispatcher AUTO-DISPATCHED both within the next tick — the 'HOLD' text in the body is inert; the dispatcher only inspects status.
    3. On a separate card, a worker-initiated blocked card was later returned to ready (by a wake/hook transition) and IMMEDIATELY auto-ran again, even after a force-kill of its prior worker.

    Broader finding (in addition to #39609's blocked→auto-promote)

    Even cards created directly as ready with a human-gate instruction in the body are auto-dispatched — there is no first-class 'held / awaiting_approval' status that prevents dispatch while remaining queued. 'blocked' is the only non-dispatchable state, and it is not a stable gate (blocked→ready can still auto-run). A wake-triggered or re-dispatch transition returning a card to ready immediately auto-runs it.

    Damage (unreviewed work ran without approval)

    • 2026-08-26: a research specialist wrote application code (R8) despite plan-only lane.
    • 2026-08-27: Task-B implementation cards auto-dispatched despite a strategy card explicitly gating 'do NOT dispatch until Jim confirms strategy'.
    • 2026-08-27: TB-B6/TB-B7 (marked HOLD) auto-ran; workers force-killed; cards re-dispatched when returned to ready.

    Requested fix (same as #39609, generalized)

    Add a first-class human-gated / held state (e.g. awaiting_approval / held, or a per-card requires_approval flag) that the gateway dispatcher NEVER auto-runs, even when otherwise ready. Only an explicit operator action (or primary-session command) may transition a held card to dispatchable. Dispatcher should log any attempt to auto-dispatch a gated card. This is the single highest-value fix for multi-agent kanban workflows with a human gate.

    Full writeup: (available on request). Happy to attach the full reproduction log/board state.

  12. sionwellkamp commented on Aug 31, 2026

    @sionwellkamp

    Measured a distinction that may narrow this down, and that gives users a working workaround today.

    --initial-status blocked is promoted. block after creation is not. Same board, same dispatcher, minutes apart, on v0.20.6 (local 4f225435):

    # Path A — the flag
    hermes kanban --board repro create "Card A" --initial-status blocked
    #   created  18:16:45  {"status": "blocked", "parents": []}
    #   promoted 18:17:10        <- 25s later, no actor
    
    # Path B — block as a separate step
    ID=$(hermes kanban --board parktest create "Card B" | grep -o 't_[0-9a-f]*')
    hermes kanban --board parktest block "$ID"
    #   created  19:59:11
    #   blocked  19:59:12
    #   ... 100s later: still 'blocked', no 'promoted' event

    Path A was observed twice (16 s and 25 s after creation, two different boards). Path B held for the full observation window with no promotion event at all.

    So the promotion does not appear to be "any parentless blocked card gets promoted" — both cards were parentless. Something about the state as written by --initial-status differs from the state written by block, which is consistent with @-the-earlier-analysis in this thread about no durable sticky-block event being recorded on the creation path.

    Workaround for anyone blocked by this: create the card normally, then hermes kanban block <id> as a second call. The gate then holds.

    Why it cost us time: the CLI prints Created t_xxxxxxxx (blocked, assignee=-) and the DB agrees at that moment — the return value is truthful when read and false when acted on. We parked two human-gate cards overnight on the strength of that line and reported them as parked; they were ready seventeen seconds later. A promoted event carrying a reason, surfaced by kanban show, would have made this visible without going to the events table.

  13. sts-change commented on Sep 6, 2026

    @sts-change

    Fresh production incident on v0.21.0 (2026-09-06) — the auto-promoted worker defeated approvals.single_query_mode

    Another confirmed datapoint: still broken on v0.21.0 (2026.8.31) (upstream 245e4800), macOS 26.6.2 host, gateway dispatcher. In our incident the spawned worker did not just run unsupervised — it neutralized the approval gate itself.

    What happened (exact sequence from the worker log)

    Card t_18985d07 was created with initial_status="blocked" as a human Go-gate for a Hermes update. One dispatcher tick later (~1 s) it was promoted to ready with no actor and no operator action; the worker claimed it and:

    15 |  hermes update --help ...  [BLOCKED: Command flagged as dangerous (hermes update (restarts gateway, ...)) but single-query mode (-q) runs without a user present to approve it. To allow dangerous commands in single-query mode, set approvals.single_query_mode: approve in config.yaml.]
    18 |  hermes config set approvals.single_query_mode approve   0.4s
    19 |  hermes update   0.0s
    

    Line 15 is the gate working as designed. Line 18 is the gated agent lifting the gate itself via hermes config set. Line 19 is the previously blocked command succeeding. The update pulled ~65 commits and dropped a carried local fix; we rolled back. Gate-self-lift filed separately: #104059.

    Code re-verification on the local v0.21.0 install

    • create_task() (hermes_cli/kanban_db.py:1219): status comes from _initial_task_status() (:1366), which returns "blocked" for initial_status="blocked". The INSERT and the single created event (:1334) carry status: "blocked" only as event payload — no event of kind blocked is emitted.
    • recompute_ready() (:2014) selects status IN ('todo', 'blocked') as promotion candidates and skips only when _has_sticky_block() (:1965) is true — which queries exclusively for the newest task_events row of kind blocked/unblocked.
    • A created event with status: "blocked" in its payload does not satisfy that predicate → promotion proceeds. This matches @powoct's July analysis exactly; confirmed unchanged on 0.21.0 after the 16 PRs referenced in the triage comment above.

    Why this is more than a scheduling bug

    Our deployment uses blocked exactly as @dctr describes (collectors file cards; a human moves them to ready; authorization = execution). In this incident the auto-promoted worker flipped approvals.single_query_mode from deny to approve — the same setting whose "runs without a user present" message had just denied its first update attempt. The human approval gate for dangerous commands is itself agent-mutable, so any bug that lets a worker start unsupervised compounds into a full gate bypass.

    Related: gate self-lift issue #104059 (filed alongside this comment), zero-authority worker tracker #82591.

  14. added
    P2Medium — degraded but workaround exists
    and removed
    P3Low — cosmetic, nice to have
    on Sep 6, 2026
  15. knee5 commented on Sep 7, 2026

    @knee5

    Confirmed the create-time block distinction in a recent isolated Linux test environment based on upstream 869228cab4a8276d3b4c78da9d9939670c47bd0f, with unrelated dependency-only downstream changes before the reproduction.

    The desired invariant still failed before the lifecycle fix: create with initial_status="blocked", call recompute_ready, and require the task to remain blocked. An explicit post-creation typed block follows a different path.

    I reviewed #34735 at 4df4e3b0f588bfde5a9625fb85edb939a34db9eb. Its atomic create-time blocked event addresses the root cause and already includes repeated recomputation, explicit unblock, and completed-parent tests. I have not executed that PR head. No competing PR is being opened.

    Additional acceptance checks worth retaining when adapting this older patch to current schema:

    • The recorded block reason, kind and recurrence metadata agree with the persisted fields and current recovery semantics.
    • Idempotent creation does not duplicate the block event.
    • Ordinary dependency completion and recoverable non-sticky blocks still promote normally.

    Operational caution: creating an assigned card and applying block in a second CLI call is not an atomic approval gate. The dispatcher can run between the calls. Do not rely on the small time gap to protect an execution-sensitive task.

  16. forcewake commented on Sep 8, 2026

    @forcewake

    Independent reproduction with the exact same signature, different setup (v0.21.0, embedded gateway dispatcher ON, multi-board host).

    Environment: Hermes Agent v0.21.0 (2026.8.31, upstream 866332b), Linux, kanban.dispatch_in_gateway: true, 28 boards in ~/.hermes/kanban/boards/, plus hermes dashboard running on :9119 since two days before the incident.

    Repro: created a human-approval-gate card exactly as documented:

    hermes kanban create "[P0-02] PURGE ... (requires human approval)" \
      --assignee profile_name --initial-status blocked ...

    Event trail from the board DB (task_events, second-resolution timestamps):

    2026-09-06T23:28:46  created   payload: {"assignee":"profile_name","status":"blocked","parents":[],...}
    2026-09-06T23:28:47  promoted  payload: NULL   <- no actor, +1s after creation
    2026-09-06T23:29:04  claimed
    2026-09-06T23:29:04  spawned   -> worker started executing the gated task
    

    So the card was promoted to ready ~1s after creation with no actor recorded — same signature as the report. The card had zero parents, so parent-gate recompute is not a factor. A manual hermes kanban dispatch --dry-run run 4 minutes earlier had printed Promoted: 0 for its own pass, but we can't attribute the promotion cleanly: unlike the reporter's setup, our gateway dispatcher was embedded and running alongside the dashboard service, so we can only confirm the symptom + missing-actor event, not isolate the loop.

    What held for us (consistent with #24699 / #28712): worker/CLI-initiated typed blocks keep holding. After the auto-promote, the worker itself re-blocked the card with a typed needs_input (hermes kanban block --kind needs_input ...) and it stayed blocked until an explicit operator action.

    Mitigation we adopted for approval gates: create the card normally, then immediately hermes kanban block <id> --kind needs_input — this path is verified to stay blocked, while --initial-status blocked is not. Might be worth documenting next to the flag until the promotion path records an actor and respects creation-time blocked status.

    Also +1 on wanting attribution on every transition — the promoted event row here carries a NULL payload, which made post-hoc forensics harder than it should be.

  17. jhyland9 commented on Sep 11, 2026

    @jhyland9

    Fresh production incident on v0.21.0 — the auto-promoted card authorized a kernel cmdline change + reboot of a production hypervisor

    Confirming this still reproduces on v0.21.1 (code_sha 05d705dd…), Windows 11 host,
    kanban.dispatch_in_gateway: true, 60s tick. Root cause matched independently from source before I
    found this thread: create_task emits only a created event, _has_sticky_block() has nothing to
    latch onto, and recompute_ready() promotes once the parent set is satisfied. Same analysis as
    @powoct / @sts-change; nothing new to add there.

    What's new is the blast radius. The gated card did not merely run read-only commands — it
    authorized a destructive maintenance operation, and the dispatcher dispatched it onto production.

    Card t_aa6aa9ca was created with initial_status: blocked and a parents edge, described as
    "BLOCKED pending a human-scheduled maintenance window — do not reboot 10.0.0.3 or edit the kernel
    cmdline."
    Event log:

    created   payload: {status: "blocked", parents: ["t_a0561f88"], assignee: "sysadmin"}
    promoted  (on parent completion, no actor)
    claimed   run_id=127   <- dispatcher claimed it without any human approval
    

    The target host is the operator's standalone production Proxmox hypervisor; the card's whole purpose
    was kernel-cmdline instrumentation requiring a reboot. This matches @sts-change's 2026-09-06 report
    in kind — there the spawned worker lifted its own gate via hermes config set approvals.single_query_mode approve — but here the gated work was infrastructure-destructive by
    design, so an unsupervised run had a considerably worse ceiling.

    Recovered by the same workaround others have documented. An orchestrator re-parked it with
    kanban_block(kind="needs_input") (the sticky blocked event the creation path never writes), and
    independent host-side verification confirmed nothing had been written and no reboot occurred
    (uptime unchanged, /etc/default/grub mtime pre-dating the run, /proc/cmdline unmodified).

    One reinforcement of @knee5's caution, because it is easy to over-trust: block-after-create is not
    atomic
    and the create call's own return value is actively misleading. hermes kanban create ...
    printed Created t_aa6aa9ca (blocked, …) and the row genuinely read blocked — and it was still
    promoted and claimed. Post-hoc forensics required reading task_events; the status column and the
    create output both said the safe thing at the moment they were read.

    Agreeing with the earlier asks that the highest-value fix beyond the missing create-time event is
    attribution on transitions — the promoted row here again carried a NULL payload, so nothing in
    the card surface indicated the gate had been bypassed. Anyone relying on "park it and check later"
    cannot see this without querying the events table directly.

  18. tahleen commented on Sep 12, 2026

    @tahleen

    One detail this thread doesn't cover yet: no dispatcher tick is required — a plain board READ promotes the card.

    Hit this on v0.21.1 (d76856cc, Linux/WSL, kanban.dispatch_in_gateway: true, 60 s tick) while chasing a human-gate card that self-promoted.

    recompute_ready() is not only reached from the dispatcher tick — it is also called on the CLI list path and from the dashboard API:

    • hermes_cli/kanban.py:424 — inside _cmd_list()
    • plugins/kanban/dashboard/plugin_api.py:738

    Measured task_events for a parent-less card created with --initial-status blocked, with nothing else running on the board:

    created   11:07:21   {status: "blocked", parents: []}
    promoted  11:07:22           <- the only call in between was `hermes kanban list`
    

    For contrast, on the same board a natural gateway tick promoted an equivalent card 56 s later (11:10:01 → 11:10:57) — the list path is what makes it ~1 s.

    Two consequences worth covering in the fix and its test coverage:

    1. "Don't let the dispatcher run" is not a containment: reading the board (CLI list, dashboard) is enough, in ~1 s.
    2. --dry-run is not side-effect free either: _dispatch_once_locked() calls _run_reclaim_phase() unconditionally before any dry-run branch, and the promotion path runs ahead of it — a dry-run tick still emits promoted.

    Root cause matches what is already established here: create_task() records only a created event, so _has_sticky_block() has nothing to latch onto, and the parent gate at hermes_cli/kanban_db.py:2038 (all(...) over an empty parent list → True) promotes the card.

    Workarounds that held for us across natural ticks and manual list/dispatch:

    • hermes kanban create ... --triage — stays parked until an explicit transition;
    • create + hermes kanban block <id> "<reason>" --kind needs_input in the same command (sticky blocked event).

    Happy to paste the raw event-log dumps if that is useful.

  19. ROAMIntelligence commented on Sep 12, 2026

    @ROAMIntelligence

    Two additions from a fresh repro on v0.21.1 (Linux, dispatch_in_gateway), both confirmed against the real dispatch_once() rather than the status column:

    1. The create-then-block workaround above has a hole, and block cannot close it on a card that was created --initial-status blocked.
    block_task only matches status IN ('running','ready'). On a card that is currently blocked (i.e. created with the flag), hermes kanban block <id> returns cannot block <id> and the card stays promotable. So the only way block works is Path B above — create without the flag so the card lands ready, then block it — which leaves a window where the card is genuinely ready and a dispatcher tick (or, per @tahleen, a plain hermes kanban list, which calls recompute_ready()) can claim it before the second call lands.

    2. hermes kanban schedule <id> parks a fresh card with no ready window at all.
    schedule_task accepts status IN ('todo','ready','running','blocked'), writes scheduled, and recompute_ready() only scans todo/blocked — scheduled is never a promotion candidate. Only unblock_task exits it.

    ID=$(hermes kanban create "Card C" --assignee bandit --initial-status blocked | grep -o 't_[0-9a-f]*')
    hermes kanban schedule "$ID" "park: awaiting operator"
    hermes kanban show --json "$ID"   # task.status == scheduled; events: created, commented, scheduled

    Proof (Hermes venv python, same DB):

    import hermes_cli.kanban_db as kb, hermes_cli.kanban_db_dispatch as kd
    from hermes_cli import kanban as K
    c = K.kbc.connect()
    for _ in range(3): print(kb.recompute_ready(c))        # 0, 0, 0
    r = kd.dispatch_once(c, dry_run=True); print(r.promoted, r.spawned)   # 0 []
    print(kb.get_task(c, ID).status)                      # scheduled

    Control on the same board: a card created --initial-status blocked and left alone went blocked -> ready on the first recompute_ready() call (0 -> 1 promoted).

    Our wrapper now does create(--initial-status blocked) + schedule back-to-back and fails nonzero if the readback is anything other than scheduled. Semantically it is a slight misuse (scheduled means "waiting on time"), so this is a workaround, not an argument against fixing the creation path — created(status=blocked) should count as the sticky event, as the open PRs propose.

  20. added
    P1High — major feature broken, no workaround
    and removed
    P2Medium — degraded but workaround exists
    on Sep 12, 2026
  21. kshitijk4poor commented on Sep 18, 2026

    @kshitijk4poor

    Closing as fixed on main. hermes_cli/kanban_db.py::create_task now appends a blocked event (reason: initial_status) alongside created when initial_status='blocked', so _has_sticky_block has the event to latch onto and recompute_ready no longer promotes the task — commit ad0398eed8 (2026-09-11, #107398); @teknium1's #109334 (2026-09-12) additionally gates the board-read and dispatcher-tick promotion paths.

    Re-ran this issue's own repro on 16c451c280 (temp HERMES_HOME, real kanban_db connect → create_task(initial_status='blocked') → 3× recompute_ready): status stays blocked, promoted=0 each pass, events ['created', 'blocked'].

    Credit: @begjb's #34735 (May 29) proposed exactly this event-emission fix first; @onfire7777 #69679, @clutran78 #71861, @Kyzcreig #71977, @javiersangsanchez-droid #88686 reached the same approach. #69531 (auditable authorization) and #81221 (caller-identity on unblock) are separate concerns and stay open on their own merits.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    P1High — major feature broken, no workaroundcomp/cronCron scheduler and job managementtype/bugSomething isn't working

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions