Repository navigation
fix(kanban): report blocking parents when refusing kanban complete - #110323
Open
liuhao1024 wants to merge 1 commit into
Open
liuhao1024 wants to merge 1 commit into
liuhao1024 wants to merge 1 commit into
Conversation
hermes kanban complete <id> printed 'unknown id or terminal state' when the task exists and the real refusal is an unfinished parent dependency. complete_task now captures the blockers (parent id + status) at the authoritative checks (pre-check and inside the write txn) and an opt-in raise_parents_refusal flag surfaces them as ParentsNotSatisfiedError; the boolean API is unchanged for every other caller. The CLI names the blockers instead of guessing. Fixes NousResearch#110315.
5 tasks done
JoaoMarcos44
added a commit
to JoaoMarcos44/hermes-agent
that referenced
this pull request
Sep 16, 2026
… delegate handoff contract kanban_complete tool collapsed every complete_task refusal into 'unknown id, stale run, or already terminal'. When a parent reopens mid-run, a worker with genuinely done work is refused for a reason the message hides, and the run burns (then crashes, re-queues, and repeats deterministic work). Name the unsatisfied parents (id, status) from a read-only task_links mirror of _parents_satisfied so the worker and the operator complete the gates instead of re-running; unknown-id and terminal refusals keep the generic text, and the dependency invariant itself is untouched (no force path). Complementary to the CLI-surface PRs NousResearch#110323/NousResearch#110330/NousResearch#110334, which touch hermes_cli/kanban_db.py + hermes_cli/kanban.py; this change is tool-surface only (tools/kanban_tools.py). Also surface the delegate_task handoff contract at spawn time: children cannot close tracked work and must return findings for the parent to apply, so a delegated card no longer burns a full run before learning it can never close (NousResearch#113373 ask 1). Tests: tests/tools/test_kanban_complete_parents_tool.py (6) — parents named, deterministic multi-parent order, unknown/terminal generic, happy path, description contract. Proven red on unfixed sources.
teknium1
pushed a commit
that referenced
this pull request
Sep 18, 2026
… delegate handoff contract kanban_complete tool collapsed every complete_task refusal into 'unknown id, stale run, or already terminal'. When a parent reopens mid-run, a worker with genuinely done work is refused for a reason the message hides, and the run burns (then crashes, re-queues, and repeats deterministic work). Name the unsatisfied parents (id, status) from a read-only task_links mirror of _parents_satisfied so the worker and the operator complete the gates instead of re-running; unknown-id and terminal refusals keep the generic text, and the dependency invariant itself is untouched (no force path). Complementary to the CLI-surface PRs #110323/#110330/#110334, which touch hermes_cli/kanban_db.py + hermes_cli/kanban.py; this change is tool-surface only (tools/kanban_tools.py). Also surface the delegate_task handoff contract at spawn time: children cannot close tracked work and must return findings for the parent to apply, so a delegated card no longer burns a full run before learning it can never close (#113373 ask 1). Tests: tests/tools/test_kanban_complete_parents_tool.py (6) — parents named, deterministic multi-parent order, unknown/terminal generic, happy path, description contract. Proven red on unfixed sources.
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What does this PR do?
hermes kanban complete <task-id>printedcannot complete <task-id> (unknown id or terminal state)when the task exists and the actual refusal was an unfinished parent dependency. The dependency invariant was correct; only the error hid the actionable reason.This PR makes
complete_taskcapture the blocking parents(id, status)at the same authoritative checks that enforce the invariant (the cheap pre-check and the re-check inside the write transaction, so the reason reflects the state the transaction actually refused — not a later re-derived guess), and surfaces them through an opt-inraise_parents_refusal=Trueflag that raisesParentsNotSatisfiedError. The boolean API (return False) is unchanged for every existing caller. The CLI opts in and now reports:Missing id and terminal-state refusals keep the generic message, and no force-complete path is added — the invariant itself is untouched.
Related Issue
Fixes #110315
Type of Change
Changes Made
hermes_cli/kanban_db.py: addedParentsNotSatisfiedError(carriesblockers+completing_task_id) and_unsatisfied_parents()— the same predicate as_parents_satisfied, enumerated in id order; both refusal points incomplete_tasknow raise it when the caller opts in via the newraise_parents_refusalkeyword (defaultFalse, boolean contract preserved).hermes_cli/kanban.py:_cmd_completepassesraise_parents_refusal=Trueand formats the captured blockers into the failure message instead of the generic unknown-id/terminal text.tests/hermes_cli/test_kanban_complete_parents_report.py: regression tests for the CLI message, deterministic multi-parent reporting, missing/terminal staying generic, valid completion unchanged, the default boolean contract, and the pre-check→transactional-check race (blockers captured inside the txn).How to Test
cannot complete <child-id>: unsatisfied parent dependencies: <parent-id> (<status>); complete the parents first (done or archived)— and the child is not completed.pytest tests/hermes_cli/test_kanban_complete_parents_report.py -q— Observed result: 6 passed.pytest tests/hermes_cli/test_kanban_parent_reopen_invalidation.py tests/hermes_cli/test_kanban_core_functionality.py tests/hermes_cli/test_kanban_db.py tests/hermes_cli/test_kanban_cli.py -q— Observed result: 66 passed, 2 skipped (pre-existing environment-dependent hook/write-guard flakes in the wider-k kanbansweep reproduce identically on a cleanupstream/maincheckout, with no failures unique to this change).Checklist
Code
fix(scope):,feat(scope):, etc.)pytest tests/ -qand all tests passDocumentation & Housekeeping
docs/, docstrings) — or N/A (docstrings updated in the touched functions)cli-config.yaml.exampleif I added/changed config keys — or N/ACONTRIBUTING.mdorAGENTS.mdif I changed architecture or workflows — or N/A