fix(kanban): make creation-time blocks sticky - #70733
Conversation
teknium1
left a comment
There was a problem hiding this comment.
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:5450in this PR). Circuit-breaker blocks are intentionally recorded asgave_upand remain auto-recoverable (hermes_cli/kanban_db.py:3962-3977,7641-7766); this branch would appendblockedand 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_uprow. - Please consolidate the overlapping create-time repair with #71147, as noted in its maintainer comment.
Automated hermes-sweeper review.
| "SELECT status, block_recurrences FROM tasks WHERE id = ?", | ||
| (task_id,), | ||
| ).fetchone() | ||
| if existing is not None and existing["status"] == "blocked": |
There was a problem hiding this comment.
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.
中文摘要
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 passedorigin/mainand passes in isolationruff check: passed