Skip to content

fix(kanban): allow respawn after explicit unblock - #62424

Open
LeonSGP43 wants to merge 1 commit into
NousResearch:mainfrom
LeonSGP43:fix/62418-respawn-unblock
Open

fix(kanban): allow respawn after explicit unblock#62424
LeonSGP43 wants to merge 1 commit into
NousResearch:mainfrom
LeonSGP43:fix/62418-respawn-unblock

Conversation

@LeonSGP43

Copy link
Copy Markdown
Contributor

Fixes #62418.

Summary

  • ignore PR URL comments that were posted before the task's latest unblocked event
  • keep guarding if a fresh PR URL comment appears after the unblock
  • cover the resumed-review flow in the respawn-guard tests and dispatch integration

Verification

  • /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

@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 Jul 11, 2026
@alt-glitch

Copy link
Copy Markdown
Collaborator

This was generated by AI during triage.

Duplicate of #46204 — both patch check_respawn_guard() in hermes_cli/kanban_db.py with the same mechanism: raise pr_cutoff to the latest unblocked task-event timestamp so PR-URL comments posted before the explicit unblock stop guarding respawn, while a fresh post-unblock PR comment still blocks. #46204 (2026-06-14) is the earlier/canonical fix. Both address issue #62418; the one-shot-override PR #62393 solves it via a distinct mechanism. Maintainer to pick.

@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 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:6897 uses unblocked.created_at + 1 as the comment cutoff. Both comments and events use int(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 at tests/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.

Comment thread hermes_cli/kanban_db.py
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)

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.

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.

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 sweeper:risk-automation Sweeper risk: may affect CI, automerge, label sync, or maintainer automation type/bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Kanban dispatcher's active_pr respawn guard blocks legitimate rework after unblock, no bypass short of manual claim+spawn

3 participants