hermes - ✅(Solved) Fix [Bug]: archiving a parent task silently deadlocks dependent children in todo [2 pull requests, 2 comments, 2 participants]

Official PRs (…)
ON THIS PAGE

Recommended Tools

×6

Utilities matched from this issue’s tags and category — try them while you read without losing context.

GitHub issue graph ai analysis

Paste a GitHub issue URL. We fetch that issue, discover linked issues from bodies/comments/timeline, collect linked pull requests, and produce a structured English report.

The report is written in English Markdown for sharing and archival.

Helpful · Quick feedback

Loading…
GitHub stats
NousResearch/hermes-agent#23180Fetched 2026-05-11 03:30:41
View on GitHub
Comments
2
Participants
2
Timeline
16
Reactions
0
Timeline (top)
mentioned ×4subscribed ×4labeled ×3commented ×2

Fix Action

Fixed

PR fix notes

PR #23298: fix(cli): warn before archiving a task with dependent children

Description (problem / solution / changelog)

Archiving a task with non-archived children silently strands them in todo: recompute_ready only promotes a child once every parent is done, so an archived parent never satisfies the gate.

What changed and why

  • hermes_cli/kanban_db.py: new dependent_child_ids(conn, task_id) returning ids of non-archived children. The DB-level archive_task() is intentionally unchanged so existing automation (and the dashboard REST callsite at plugins/kanban/dashboard/plugin_api.py) keep working; the helper is the building block for the new check.
  • hermes_cli/kanban.py (/kanban archive):
    • Adds mutually-exclusive --cascade and --unlink-children flags.
    • When a task has dependent children and neither flag is set: prompts interactively ([u]nlink / [a]rchive / [c]ancel) on a TTY; refuses with an actionable stderr message off-TTY (so scripted callers fail loudly instead of stranding tasks).
    • --cascade walks the subtree and archives descendants leaf-first, then the root.
    • --unlink-children calls unlink_tasks for each edge (which already triggers recompute_ready), then archives the parent.
  • Tasks with no dependent children archive exactly as before — no behavior change for the common path.

How to test

  • pytest tests/hermes_cli/test_kanban_db.py tests/hermes_cli/test_kanban_core_functionality.py -q (236 passed, 1 skipped locally).
  • New tests cover: helper returns only non-archived children; helper is empty for orphan tasks; raw-DB reproducer of the stranded-child bug; CLI refuses without flags + non-TTY; --unlink-children promotes the child to ready; --cascade archives the entire subtree; flags are mutually exclusive.
  • Manual: hermes kanban archive <parent> on a TTY now shows the prompt; off-TTY (e.g. run_slash) prints the refusal and exits 1.

What platforms tested on

  • macOS on darwin-arm64 (local pytest run on Python 3.11)

The broader tests/hermes_cli/ run shows 14 unrelated pre-existing failures (gateway service/wsl, model_switch custom providers, web_server plugin auth, list_picker, update hangup) on baseline main; those are not touched by this change.

Fixes #23180

<!-- autocontrib:worker-id=issue-new-08cc24dc kind=pr-open -->

Changed files

  • hermes_cli/kanban.py (modified, +107/-2)
  • hermes_cli/kanban_db.py (modified, +18/-0)
  • tests/hermes_cli/test_kanban_core_functionality.py (modified, +67/-0)
  • tests/hermes_cli/test_kanban_db.py (modified, +32/-0)

PR #23325: fix(kanban): treat archived parent tasks as terminal for dependency resolution

Description (problem / solution / changelog)

Summary

  • Fixes silent deadlock where child tasks stay stuck in todo forever when their parent task is archived
  • recompute_ready and claim_task now treat archived as a terminal status alongside done, allowing children to proceed when their parent is archived
  • Two-line change: updated the parent status check in both functions from == 'done' / != 'done' to IN ('done', 'archived') / NOT IN ('done', 'archived')

Why

When a parent task is archived, its dependent children should be allowed to proceed — the parent is no longer going to complete, so waiting for it would strand the children indefinitely. This is the simplest fix that preserves the existing dependency resolution semantics without adding interactive prompts.

Fixes #23180.

Changed files

  • cli.py (modified, +27/-4)
  • gateway/run.py (modified, +6/-9)
  • hermes_cli/kanban_db.py (modified, +3/-3)

Code Example

1. create parent A
2. create child B with parent=A, child C with parent=A
3. archive A
B and C stay todo forever (recompute_ready promotes 0 tasks)

---

Task 'A' has 2 dependent child tasks: B, C.
What should happen to them?

  [1] Unlink — remove the dependency on A and let them proceed
  [2] Archive — also archive B and C
  [3] Cancel — don't archive A either
RAW_BUFFERClick to expand / collapse

Current Behavior

When a task is archived via archive_task, dependent child tasks are left permanently stuck in todorecompute_ready only checks for status == 'done', so an archived parent never satisfies the gate.

1. create parent A
2. create child B with parent=A, child C with parent=A
3. archive A
   → B and C stay todo forever (recompute_ready promotes 0 tasks)

There is no warning when archiving a task that has dependent children. The user archives a parent, forgets about the children, and they silently rot in todo.

Proposed Solution

When archive_task is called on a task that has dependent child tasks (non-archived children linked via task_links), give the user a choice:

Task 'A' has 2 dependent child tasks: B, C.
What should happen to them?

  [1] Unlink — remove the dependency on A and let them proceed
  [2] Archive — also archive B and C
  [3] Cancel — don't archive A either

Implementation sketch:

  • A new helper dependent_child_ids(conn, parent_id) -> list[str] queries children
  • The caller checks before calling archive_task
  • If children exist, present the choice; if none, archive immediately

This is an interaction change — no modification to dependency resolution semantics.

Alternative / Follow-up

A simpler variant is warning-only. Separately, whether archived should be treated as terminal for dependency resolution (child auto-promotes) can be discussed as its own follow-up.

References

Vote matrix · Quick signals

Works
Did the solution work? Tap to confirm.
Easy Fix
Was it a quick fix?
Time Saver
Did it save you time?
Blocking
Was it severely blocking?
Common Issue
Are others likely hitting this too?
Flaky / Intermittent
Is it intermittent?
Verified / Reproducible
Can you reproduce it reliably?
Loading…

Still need to ship something?

×6

Another batch ranked right after the header list — different links, same matching logic.

Back to top recommendations

TRENDING