Skip to content

kanban: make active_pr respawn guard opt-in (default off) - #42003

Closed
sergeikabuldzhanov wants to merge 1 commit into
NousResearch:mainfrom
sergeikabuldzhanov:fix/kanban-active-pr-guard-default-off
Closed

kanban: make active_pr respawn guard opt-in (default off)#42003
sergeikabuldzhanov wants to merge 1 commit into
NousResearch:mainfrom
sergeikabuldzhanov:fix/kanban-active-pr-guard-default-off

Conversation

@sergeikabuldzhanov

Copy link
Copy Markdown

The active_pr respawn guard defers re-dispatch of any ready task whose recent comments contain a GitHub PR URL (check_respawn_guard, kanban_db.py). It assumes a worker already opened a PR and re-spawning risks a duplicate.

In a human-reviewed / human-merged workflow this is pure friction: a re-spawn can never silently land a duplicate or merged PR, yet a task that has produced a PR gets stuck in ready indefinitely (no --force dispatch flag exists in this version to override it). The other two guard reasons (blocker_auth, recent_success) remain useful and are unchanged.

Change

Gate only the active_pr branch behind HERMES_KANBAN_RESPAWN_GUARD_ACTIVE_PR (default off; set 1/true to restore the legacy behavior). blocker_auth, recent_success, and rate_limit_cooldown are untouched.

Tests

tests/hermes_cli/test_kanban_db.py updated to cover both states:

  • test_respawn_guard_active_pr_disabled_by_default — PR-URL comment does NOT defer by default
  • test_respawn_guard_active_pr_in_comment_when_enabled — opt-in flag restores deferral
  • test_dispatch_active_pr_spawns_by_defaultdispatch_once spawns a PR-commented task by default
  • existing enabled-path tests gated behind the env var via monkeypatch

All 19 respawn-guard tests pass:

pytest tests/hermes_cli/test_kanban_db.py -k "respawn_guard or active_pr"
19 passed, 194 deselected

Backwards-compatible: anyone relying on the old behavior sets HERMES_KANBAN_RESPAWN_GUARD_ACTIVE_PR=1.

Every PR in this deployment is human-reviewed and human-merged, so re-spawning
a task that already produced a PR cannot silently land a duplicate/merged PR —
the guard only created friction (tasks stuck 'ready' with no --force flag in
this version). Gate it behind HERMES_KANBAN_RESPAWN_GUARD_ACTIVE_PR=1 (default
off). blocker_auth and recent_success guards are unchanged. Tests updated to
cover both default-off and explicitly-enabled behavior.

(cherry picked from commit b93fcc3e10bfd673cfa509d917fb927b9b84dfc7)
@alt-glitch alt-glitch added type/feature New feature or request P3 Low — cosmetic, nice to have labels Jun 8, 2026
@teknium1

Copy link
Copy Markdown
Contributor

Thanks for isolating the active_pr path and adding coverage for both proposed states.

This automated hermes-sweeper review is closing this under the standing configuration policy:

  • The PR adds HERMES_KANBAN_RESPAWN_GUARD_ACTIVE_PR as a new user-facing, non-secret behavioral setting (hermes_cli/kanban_db.py, PR commit 0c5b0ff6dcf3). Hermes requires such settings to live in config.yaml, not a new HERMES_* environment variable.
  • Current main intentionally retains the active_pr guard: check_respawn_guard() identifies a recent PR URL as a duplicate-PR risk (hermes_cli/kanban_db.py:7020-7023), and the Kanban docs describe it as preventing repeat worker storms (website/docs/user-guide/features/kanban.md:704-706).

If maintainers want this behavior configurable, please re-scope it to a documented kanban.* config.yaml setting integrated with the existing configuration path rather than an environment-variable toggle.


Closed as not-planned per standing maintainer policy (env-var-for-config). This is a design-direction decision, not a code-quality judgment — see the Contribution Rubric in AGENTS.md for what the project is looking for. If you believe this policy was misapplied to your change, comment here and a maintainer will take a look.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

P3 Low — cosmetic, nice to have sweeper:not-planned Sweeper: closed per standing maintainer policy (design direction) type/feature New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants