feat(kanban): support operator skill/failure/claim recovery via edit - #82234
Open
hendrixfreire wants to merge 1 commit into
Open
hendrixfreire wants to merge 1 commit into
hendrixfreire wants to merge 1 commit into
Conversation
Adds a first-class recovery surface to `hermes kanban edit` (and the dashboard task drawer) for the most common post-dispatch failures, so operators no longer need to edit the SQLite DB by hand (issue NousResearch#22925): * `--skills NAME...` replaces a task's force-loaded skills (the "Unknown skill(s)" dispatch-failure class); path-like names, toolset names, and comma-joined strings are rejected with a clear usage error. `--clear-skills` (or `--skills []`) stores an explicit empty list, distinct from unset (= profile defaults). * `--reset-failures` zeroes consecutive_failures and clears last_failure_error so the dispatcher's circuit breaker stops tripping. * `--clear-claim` clears a stale (TTL-expired) claim and returns the task to ready, closing the dangling run as `reclaimed`; refuses a live claim. Safety invariants (kernel kanban_db.edit_task_recovery, shared by CLI, /kanban, and dashboard API): * Skills/failure edits are refused while a task is actively claimed/running (a live worker's payload is never mutated underneath it). * `--clear-claim` refuses a claim whose TTL has not expired (use reclaim). * Every applied edit records an `edited` event + a `RECOVERY EDIT:` comment under the operator's name; no recovery path touches the SQLite DB directly. Ships the matching dashboard API endpoint POST /tasks/:id/recovery and the Skill recovery control in the task drawer (Save & retry, disabled while a live worker is claimed), plus docs (kanban.md recovery section, cli-commands reference, slash help) and E2E regression tests for the blocked dispatch-failure -> edit/clear skills -> reset failures -> unblock loop on default and named boards, including the audit trail. Closes NousResearch#22925
Contributor
|
This was generated by AI during triage. Summary: Problems:
Solution: Checked against |
Author
|
Thanks for the review — good catch. I removed the auto-close keyword so this PR no longer resolves #22925. Changes applied:
The issue now stays open, correctly signaling that the proposed |
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?
Adds a first-class operator recovery surface to Hermes Kanban so the most common
post-dispatch failures can be fixed through supported CLI/API/dashboard paths
instead of editing the SQLite database by hand (issue #22925).
hermes kanban edit <id>(and/kanban edit) gains recovery flags shared by asingle kernel function (
kanban_db.edit_task_recovery) that the CLI, the/kanbangateway command, and the dashboard API all call:--skills NAME...— replace a task's force-loaded skills (the "Unknownskill(s)" dispatch-failure class). Path-like names, toolset names, and
comma-joined strings are rejected with a clear usage error; namespaced hub
ids like
official/category/nameare preserved.--clear-skills(alias--skills []) — store an explicit empty skill list,distinct from unset (= profile defaults).
--reset-failures— zeroconsecutive_failuresand clearlast_failure_errorso the dispatcher's circuit breaker stops tripping.--clear-claim— clear a stale (TTL-expired) claim and return the taskto
ready, closing the dangling run asreclaimed; refuses a live claim.The dashboard exposes the same flow in the task drawer as a Skill recovery
control (replace/clear skills, reset failures, clear stale claim, and a
Save & retry action that applies the edit then unblocks to
ready), backedby
POST /api/plugins/kanban/tasks/:id/recovery.Related Issue
Refs #22925
Related/duplicate PRs found in duplicate-check:
loops. Complementary: that PR prevents bad skills from being created; this
one gives operators a supported way to repair already-bad tasks. They do not
conflict.
commands. Overlapping intent; superseded. This PR is the focused delivery of
the recovery surface requested in [Feature]: hermes kanban edit should support --skills, --reset-failures, and --clear-claim for common recovery without direct DB access #22925.
Type of Change
Changes Made
hermes_cli/kanban_db.py— newedit_task_recovery()kernel function withactive-claim guard, live-claim guard, audit trail (
editedevent + operatorcomment); refactored skill normalization/validation into shared
_normalize_skill_names()(used by both create and recovery), addingpath-like-name rejection.
hermes_cli/kanban.py—editsubcommand recovery flags,--skills []alias handling, clear help text, slash help row.
plugins/kanban/dashboard/plugin_api.py—POST /tasks/:id/recoveryendpoint (400/404/409 mapping, returns updated task).
plugins/kanban/dashboard/dist/index.js+dist/style.css— Skill recoverycontrol in the task drawer (disabled while a live worker is claimed).
tests/hermes_cli/test_kanban_task_skill_recovery.py— new E2E regressiontests: kernel API + CLI recovery, live-claim guard, stale-claim clear, path
rejection, audit trail, default + named boards.
tests/plugins/test_kanban_dashboard_plugin.py— dashboard endpoint tests.website/docs/user-guide/features/kanban.md— new "Recovering a task aftera dispatch failure" section + REST table row.
website/docs/reference/cli-commands.md—editCLI reference row.How to Test
hermes kanban edit t_xxx --skills translation --reset-failures)readyand dispatches;hermes kanban show t_xxxshows an
editedevent and aRECOVERY EDIT: skills, failurescomment.Automated verification:
scripts/run_tests.sh tests/hermes_cli/test_kanban_task_skill_recovery.py tests/plugins/test_kanban_dashboard_plugin.py→ 66 passed / 0 failedscripts/run_tests.sh(full kanban sweep, 42 files) → 268 passed / 0 failedscripts/run_tests.sh tests/cli/→ 953 passed / 0 failedruff checkon all touched files → passscripts/check-windows-footguns.py --all→ pass (939 files)node --check plugins/kanban/dashboard/dist/index.js→ exit 0Checklist
Code
feat(kanban): …)pytest tests/ -qand all tests pass (viascripts/run_tests.sh)Documentation & Housekeeping
cli-config.yaml.example— N/A (no new config keys)CONTRIBUTING.md/AGENTS.md— N/A (no architecture/workflow change to those docs)/and\separators;check-windows-footguns.pypassesScreenshots / Logs
Test evidence (commands + results) captured during validation; see "How to Test"
above for the summary counts.