Skip to content

feat(kanban): auto-subscribe, rerun command, and test coverage - #29891

Closed
crayfish-ai wants to merge 3 commits into
NousResearch:mainfrom
crayfish-ai:pr/kanban-auto-subscribe-rerun-coder-fixes
Closed

feat(kanban): auto-subscribe, rerun command, and test coverage#29891
crayfish-ai wants to merge 3 commits into
NousResearch:mainfrom
crayfish-ai:pr/kanban-auto-subscribe-rerun-coder-fixes

Conversation

@crayfish-ai

Copy link
Copy Markdown
Contributor

Summary

Three clean commits providing notification auto-subscribe, task rerun capability, and corresponding test coverage for the kanban workflow system.

Commits

1. feat(kanban): auto-subscribe on CLI create from --subscribe-* args or env vars

Adds notification subscription auto-creation when tasks are created via the CLI or agent tool. When --subscribe-platform / --subscribe-chat-id CLI flags or HERMES_NOTIFY_PLATFORM / HERMES_NOTIFY_CHAT_ID env vars are set, create_task() automatically creates a kanban_notify_subs entry in the same write transaction as the task row.

  • kanban_db.py: subscribe parameter to create_task(), env-var fallback resolution
  • kanban.py: --subscribe-* CLI arguments and _infer_subscribe_from_env() helper
  • Tests: 76 lines new

2. feat(kanban): add rerun_task function + CLI rerun command

Adds rerun_task() to reset completed/blocked/archived/gave_up tasks to ready. Preserves notification subscriptions, re-evaluates parent gates, clears claim state and failure counters.

  • kanban_db.py: +120 lines for rerun_task + _parent_counts_as_done_for_rerun()
  • kanban.py: +28 lines for CLI rerun command

3. refactor(kanban): coder fixes per analyst review

  • T1: 17 rerun_task tests (+420 lines) covering all state transitions, parent gates, notifications
  • T2: Extract _resolve_subscribe_from_env() to eliminate triple-subscribe duplication
  • T3: 6 scratch GC tests (+313 lines) covering active child deferral, archived release, dir immunity

Test Results

  • All 192 tests passed (coder round)
  • All 175 tests passed (reviewer round)

Adds rerun_task() to kanban_db.py and 'hermes kanban rerun' CLI command:
- Resets completed/blocked/archived/gave_up tasks to ready for retry
- Preserves notification subscriptions (UPDATE last_event_id, not DELETE)
- Re-evaluates parent gates (review-required blocks counted as satisfied)
- Clears claim state, run pointer, failure counter
- Includes _parent_counts_as_done_for_rerun() helper

Note: build_worker_context() workspace path check from original combined
commit is N/A — upstream code restructured, no longer exposes parent
workspace paths directly.
- T1: 17 rerun_task tests (test_kanban_db_rerun.py) — reset, parent gates,
  notification retention, failure clearing, assignee override, events, cleanup
- T2: Extract _resolve_subscribe_from_env() to eliminate triple-subscribe duplication
- T3: 6 multi-child scratch GC tests (test_kanban_scratch_gc.py) — active child
  defers cleanup, archived/gave_up release, dir workspace immunity

All 192 tests passed (coder) + 175 tests passed (reviewer)
@alt-glitch alt-glitch added comp/plugins Plugin system and bundled plugins type/feature New feature or request P3 Low — cosmetic, nice to have labels May 21, 2026
@alt-glitch

Copy link
Copy Markdown
Collaborator

This is a re-implementation of the auto-subscribe + rerun feature. Prior attempts: #29097 (closed), #28331 (closed), #29739 (closed), #29840 (closed), #28720 (open). See also #19718 (merged then reverted). P3 per plugin-provider-demotion — kanban is a plugin feature, not core.

@crayfish-ai

Copy link
Copy Markdown
Contributor Author

Closing — replaced by a focused, 143-line version that removes the ambient env-var fallback and uses get_session_env() at call sites.

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

Labels

comp/plugins Plugin system and bundled plugins P3 Low — cosmetic, nice to have type/feature New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants