Skip to content

fix(kanban): active_pr respawn guard honors an explicit unblock (carry #46204) - #15

Merged
cwest merged 1 commit into
cwest/integrationfrom
topic/active-pr-unblock-cutoff
Jun 28, 2026
Merged

fix(kanban): active_pr respawn guard honors an explicit unblock (carry #46204)#15
cwest merged 1 commit into
cwest/integrationfrom
topic/active-pr-unblock-cutoff

Conversation

@cwest

@cwest cwest commented Jun 28, 2026

Copy link
Copy Markdown
Owner

What

Make the kanban active_pr respawn guard honor an explicit unblock, so the
review→author rework loop can spawn the author without waiting out the 24h
PR window.

Why

check_respawn_guard's active_pr guard refuses to spawn a ready task that
has a GitHub PR URL in a recent comment (24h window), to stop a builder
re-opening a duplicate PR. But when a reviewer bounces a card back to the author
to rework the same PR, the card lands in status='ready' still carrying the
build-handoff PR-URL comment — so the guard wedges the author out of spawning
for up to 24h and the inner rework loop can't complete autonomously.

Live symptom on this homestead: card t_2c6bd5f2 / PR #68 — repeated
respawn_guarded {'reason': 'active_pr'}, card stuck ready after a review
bounce.

How

Use the latest unblocked task event as an additional lower bound on the
PR-comment scan window (pr_cutoff = max(window_start, latest_unblock_ts)):

  • PR URLs posted before a deliberate unblock no longer veto the respawn — an
    unblock is the operator/orchestrator's green light to resume on that PR.
  • PR URLs at/after the unblock still guard (duplicate-PR protection intact).
  • Same-second comments stay guarded conservatively (timestamps are second-granular).

The rework loop is then: reviewer ends with kanban_block → orchestrator
unblocks + assigns the author → author spawns immediately. block/unblock
are first-class CLI verbs, so this stays CLI-only.

Relationship to NousResearch#46549 (already carried)

Additive, not redundant. NousResearch#46549 bypasses the guard for status='review' only;
the author-rework card is in ready, which NousResearch#46549 explicitly does not cover.
The cutoff is applied inside the existing if not is_review: block so the
two compose.

Provenance

Carries the mechanism from upstream NousResearch#46204
(dannyfranca), adapted to this fork's line context (our base already wraps the
active_pr block in NousResearch#46549's is_review guard, so a raw cherry-pick conflicts).
Logic is byte-equivalent to upstream; placement differs to compose with NousResearch#46549.
Addresses upstream issue NousResearch#29458. Tracked in PATCHES.md (upstream-pending) and
docs/patches/2026-06-28-pr46204-active-pr-unblock-cutoff.md; auto-retires when
NousResearch#46204 merges upstream.

Tests

The active_pr respawn guard in check_respawn_guard refuses to spawn a
ready task that has a GitHub PR URL in a recent comment (within the 24h
_RESPAWN_GUARD_PR_WINDOW), to prevent a builder re-opening a duplicate
PR. But in the one-card review lifecycle, when a reviewer bounces a card
back to the author to rework the SAME PR, the card lands in
status='ready' still carrying the build-handoff PR-URL comment — so the
guard wedges the author out of spawning for up to 24h and the rework
loop cannot complete.

Use the latest 'unblocked' task event as an additional lower bound on
the PR-comment scan window: PR URLs posted before a deliberate unblock
no longer veto the respawn (the unblock is the operator/orchestrator's
green light to resume work on that PR), while URLs at or after the
unblock still guard against a genuine duplicate-PR. Same-second comments
stay guarded conservatively (timestamps are second-granular).

This is additive over the carried NousResearch#46549 (which bypasses the guard only
for status='review'); the author-rework card is in 'ready', which NousResearch#46549
does not cover. Applied inside the existing `if not is_review:` block so
the two compose.

Carries the mechanism from upstream PR NousResearch#46204 by dannyfranca, adapted to
this fork's line context (our base already wraps the active_pr block in
the NousResearch#46549 is_review guard, so a raw cherry-pick would conflict). Adds 3
invariant tests and the matching docstring + kanban.md docs. Tracked in
PATCHES.md and docs/patches/2026-06-28-pr46204-active-pr-unblock-cutoff.md;
auto-retires when NousResearch#46204 merges upstream.

Upstream-PR: NousResearch#46204
Upstream-Issue: NousResearch#29458
Co-authored-by: dannyfranca <dannyfranca@users.noreply.github.com>
@cwest
cwest merged commit c2168fe into cwest/integration Jun 28, 2026
8 checks passed
@cwest
cwest deleted the topic/active-pr-unblock-cutoff branch June 28, 2026 19:22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant