fix(kanban): allow respawn after explicit unblock - #62424
Conversation
Duplicate of #46204 — both patch |
teknium1
left a comment
There was a problem hiding this comment.
Thanks for the focused fix and dispatch-level regression coverage. The current-main premise is verified: check_respawn_guard() returns active_pr for recent PR comments without considering an unblock (hermes_cli/kanban_db.py:6881-6888), and dispatch_once() defers such tasks (hermes_cli/kanban_db.py:7249-7260).
Problems
hermes_cli/kanban_db.py:6897usesunblocked.created_at + 1as the comment cutoff. Both comments and events useint(time.time())timestamps (hermes_cli/kanban_db.py:2929,:3115), so a PR comment posted after unblock in the same second is ignored and can permit duplicate work. The new test sleeps past that boundary attests/hermes_cli/test_kanban_db.py:1973, so it does not cover the ordering ambiguity.
Suggested changes
- Keep the cutoff inclusive at the unblock second and add a same-second regression test that expects
active_pr; this conservatively preserves the duplicate-PR guard where ordering cannot be reconstructed from second-resolution timestamps.
Automated hermes-sweeper review.
| if last_unblocked is not None: | ||
| # Timestamps are second-granularity, so require comments to land after | ||
| # the unblock second to count as part of the resumed review round. | ||
| pr_cutoff = max(pr_cutoff, int(last_unblocked["created_at"]) + 1) |
There was a problem hiding this comment.
Both add_comment() and _append_event() persist int(time.time()) timestamps, so adding + 1 excludes a PR comment written after the unblock within the same second. That permits the duplicate-work case this guard is meant to prevent. Keep this cutoff inclusive at the unblock second and add a deterministic same-second regression test.
Fixes #62418.
Summary
unblockedeventVerification
/Users/leongong/Desktop/LeonProjects/worktrees/hermes-agent/.base/.venv/bin/python -m py_compile hermes_cli/kanban_db.py tests/hermes_cli/test_kanban_db.py/Users/leongong/Desktop/LeonProjects/worktrees/hermes-agent/.base/.venv/bin/python -m pytest tests/hermes_cli/test_kanban_db.py -k 'respawn_guard'git diff --check