From ae6817f7f735735d8b6bf928c672002df0fca07a Mon Sep 17 00:00:00 2001 From: teknium1 <127238744+teknium1@users.noreply.github.com> Date: Thu, 28 May 2026 23:16:20 -0700 Subject: [PATCH] fix(kanban): add --reason flag to unblock for symmetry with block (#30897) `hermes kanban unblock review-required: ...` parsed every trailing word as another task_id (since `task_ids` is `nargs='+'`), then quietly failed on each non-existent id with "cannot unblock review-required: (not blocked/scheduled?)". Reporter saw this as asymmetric with `block ` which accepts positional reason words. Fix: add a `--reason "..."` flag that, when provided, is appended as a `UNBLOCK: ` comment before the unblock transition. Bulk syntax (`unblock t_a t_b t_c`) is preserved unchanged. Co-authored-by: julio-cloudvisor <211828103+julio-cloudvisor@users.noreply.github.com> --- hermes_cli/kanban.py | 13 ++++++++++++- scripts/release.py | 1 + 2 files changed, 13 insertions(+), 1 deletion(-) diff --git a/hermes_cli/kanban.py b/hermes_cli/kanban.py index 8d52714c2..a6e76fe35 100644 --- a/hermes_cli/kanban.py +++ b/hermes_cli/kanban.py @@ -548,6 +548,11 @@ def build_parser(parent_subparsers: argparse._SubParsersAction) -> argparse.Argu help="Additional task ids to schedule with the same reason (bulk mode)") p_unblock = sub.add_parser("unblock", help="Return one or more blocked/scheduled tasks to ready") + p_unblock.add_argument( + "--reason", + default=None, + help="Optional reason/note — recorded as a comment before unblocking. Quote multi-word reasons.", + ) p_unblock.add_argument("task_ids", nargs="+") p_promote = sub.add_parser( @@ -1978,14 +1983,20 @@ def _cmd_unblock(args: argparse.Namespace) -> int: if not ids: print("at least one task_id is required", file=sys.stderr) return 1 + reason = getattr(args, "reason", None) + if reason is not None: + reason = reason.strip() or None + author = _profile_author() if reason else None failed: list[str] = [] with kb.connect_closing() as conn: for tid in ids: + if reason: + kb.add_comment(conn, tid, author, f"UNBLOCK: {reason}") if not kb.unblock_task(conn, tid): failed.append(tid) print(f"cannot unblock {tid} (not blocked/scheduled?)", file=sys.stderr) else: - print(f"Unblocked {tid}") + print(f"Unblocked {tid}" + (f": {reason}" if reason else "")) return 0 if not failed else 1 diff --git a/scripts/release.py b/scripts/release.py index e28cccdad..4d4a1eb5d 100755 --- a/scripts/release.py +++ b/scripts/release.py @@ -59,6 +59,7 @@ AUTHOR_MAP = { "wangpuv@hotmail.com": "wangpuv", "202622897+ticketclosed-wontfix@users.noreply.github.com": "ticketclosed-wontfix", "wuxuebin1993@gmail.com": "victorGPT", + "211828103+julio-cloudvisor@users.noreply.github.com": "julio-cloudvisor", # teknium (multiple emails) "teknium1@gmail.com": "teknium1", "kenyon1977@gmail.com": "kenyonxu",