Skip to content

fix(kanban): make creation-time blocks sticky - #70733

Open
aslxiaomu wants to merge 1 commit into
NousResearch:mainfrom
aisilun:fix/xiaomu-kanban-auth-control-20260724
Open

fix(kanban): make creation-time blocks sticky#70733
aslxiaomu wants to merge 1 commit into
NousResearch:mainfrom
aisilun:fix/xiaomu-kanban-auth-control-20260724

Conversation

@aslxiaomu

Copy link
Copy Markdown

中文摘要

  • create_task(initial_status="blocked")现在在同一 SQLite 事务写入created和初始blocked事件。
  • recompute_ready不再把创建即阻断的任务提升为ready
  • block_task允许给尚未运行且已 blocked 的任务追加持久原因事件,不伪造 run,也不重复增加循环次数。
  • 显式unblock_task仍是唯一解除路径。

Summary

Make creation-time blocked tasks sticky by persisting the initial block event atomically. Allow an already-blocked, never-run task to receive a durable reason annotation without fabricating a run or inflating recurrence counters.

Verification

  • tests/hermes_cli/test_kanban_blocked_sticky.py: 10 passed
  • affected matrix: 645 passed, 1 skipped, plus one pre-existing order-dependent WAL warning test failure; the same failure reproduces on origin/main and passes in isolation
  • ruff check: passed
  • full-suite attempt is not claimed green: local E2E logging teardown races produced pre-existing failures and timed out at 600s

@alt-glitch alt-glitch added type/bug Something isn't working comp/cron Cron scheduler and job management P3 Low — cosmetic, nice to have needs-decision Awaiting maintainer decision before any implementation labels Jul 24, 2026

@teknium1 teknium1 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for identifying a real create-time state gap: current create_task emits only created for initial_status="blocked" (hermes_cli/kanban_db.py:3172-3191), while recompute_ready only preserves a blocked row when _has_sticky_block() finds a blocked event (hermes_cli/kanban_db.py:3950-4035).

Problems

  • The new annotation branch matches any status == "blocked" row, not specifically a creation-time hold (hermes_cli/kanban_db.py:5450 in this PR). Circuit-breaker blocks are intentionally recorded as gave_up and remain auto-recoverable (hermes_cli/kanban_db.py:3962-3977, 7641-7766); this branch would append blocked and make them sticky.

Suggested changes

  • Retain the atomic create-time event, but constrain/remove the annotation path so it cannot alter circuit-breaker recovery semantics.
  • Add a regression for an auto-blocked gave_up row.
  • Please consolidate the overlapping create-time repair with #71147, as noted in its maintainer comment.

Automated hermes-sweeper review.

Comment thread hermes_cli/kanban_db.py
"SELECT status, block_recurrences FROM tasks WHERE id = ?",
(task_id,),
).fetchone()
if existing is not None and existing["status"] == "blocked":

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This condition identifies every blocked row, not just one created with initial_status="blocked". Circuit-breaker rows are intentionally blocked with a gave_up event and should remain auto-recoverable; appending blocked here makes _has_sticky_block() suppress that recovery. Please require a durable creation-time marker or remove this annotation path.

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 needs-decision Awaiting maintainer decision before any implementation P3 Low — cosmetic, nice to have sweeper:blast-moderate Sweeper blast radius: moderate — a subsystem or single platform sweeper:risk-compatibility Sweeper risk: may break existing users, config, migrations, defaults, or upgrades type/bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants