Skip to content

fix(kanban): keep initial_status=blocked tasks blocked across recompute_ready - #46565

Open
halonke wants to merge 1 commit into
NousResearch:mainfrom
halonke:fix/kanban-initial-status-blocked
Open

fix(kanban): keep initial_status=blocked tasks blocked across recompute_ready#46565
halonke wants to merge 1 commit into
NousResearch:mainfrom
halonke:fix/kanban-initial-status-blocked

Conversation

@halonke

@halonke halonke commented Jun 15, 2026

Copy link
Copy Markdown

Problem

hermes kanban create --initial-status blocked reports the card as blocked, but it
lands in ready — and the dispatcher immediately picks it up. Backlog items meant
to stay parked get auto-dispatched.

Root cause

create_task() writes status='blocked' for initial_status="blocked" but only
emits a created event. _has_sticky_block() looks for a blocked/unblocked
event, finds none, returns False, so recompute_ready() (run on every
kanban list and by the dispatcher) auto-promotes the card back to ready.

Fix

Emit an explicit blocked event at create time when initial_status="blocked", so
_has_sticky_block() treats the card as sticky and recompute_ready() leaves it
parked. Adds a regression test.

Tests

  • New test_create_task_initial_status_blocked_survives_recompute — fails before, passes after.
  • Full tests/hermes_cli/test_kanban_db.py: 215 passed.

🤖 Generated with Claude Code

…te_ready

create_task() parks a card directly in status='blocked' when called with
initial_status="blocked", but only emitted a "created" event.
_has_sticky_block() looks for a "blocked"/"unblocked" event, finds none,
returns False, so recompute_ready() (invoked on every `kanban list` and by
the dispatcher) auto-promotes the card straight back to "ready" — silently
dispatching tasks that were meant to stay parked in the backlog.

Emit an explicit "blocked" event at create time so _has_sticky_block() treats
the card as sticky. Add a regression test covering create+recompute.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
@alt-glitch alt-glitch added type/bug Something isn't working P3 Low — cosmetic, nice to have comp/cron Cron scheduler and job management duplicate This issue or pull request already exists labels Jun 15, 2026
@alt-glitch

Copy link
Copy Markdown
Collaborator

Duplicate of #34735 — same fix: emit an explicit "blocked" event when create_task is called with initial_status="blocked", so _has_sticky_block() returns True and recompute_ready() no longer auto-promotes the parked card back to ready. Part of the sticky-block cluster (#39085 / #41497 / #46274; canonical merged #28994). #34735 is the earliest open PR with this approach.

@teknium1

Copy link
Copy Markdown
Contributor

Thanks for the focused regression fix. The premise still holds on current main: create_task() writes the initially blocked status at hermes_cli/kanban_db.py:2585-2590 but emits only created at hermes_cli/kanban_db.py:2670-2683. _has_sticky_block() recognizes only blocked/unblocked events (hermes_cli/kanban_db.py:3273-3279), so recompute_ready() does not skip this task (hermes_cli/kanban_db.py:3324) and a parent-free card meets the promotion condition (hermes_cli/kanban_db.py:3336).

The proposed event is written in the existing creation transaction, matching the sticky-block mechanism introduced for worker/operator blocks. The central create_task() fix also covers both CLI creation (hermes_cli/kanban.py:1329-1349) and worker kanban_create (tools/kanban_tools.py:918-942).

Automated hermes-sweeper review.

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

Labels

comp/cron Cron scheduler and job management duplicate This issue or pull request already exists P3 Low — cosmetic, nice to have sweeper:blast-moderate Sweeper blast radius: moderate — a subsystem or single platform type/bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants