From fb0f19d4fd8b99a77fc3c8d23dd1e60ecbee13e5 Mon Sep 17 00:00:00 2001 From: Teknium <127238744+teknium1@users.noreply.github.com> Date: Wed, 2 Sep 2026 21:00:43 -0700 Subject: [PATCH] =?UTF-8?q?refactor(kanban-cli):=20ops=20=E2=80=94=20dispa?= =?UTF-8?q?tch=20--json=20scalar=20fields=20via=20one=20comprehension=20(o?= =?UTF-8?q?utput=20byte-identical)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- hermes_cli/kanban_ops.py | 17 ++++++----------- 1 file changed, 6 insertions(+), 11 deletions(-) diff --git a/hermes_cli/kanban_ops.py b/hermes_cli/kanban_ops.py index 83aa2e6ab1..3aa871d983 100644 --- a/hermes_cli/kanban_ops.py +++ b/hermes_cli/kanban_ops.py @@ -65,7 +65,9 @@ def _cmd_dispatch(args: argparse.Namespace) -> int: default_assignee = (_kanban_cfg.get("default_assignee") or "").strip() or None max_in_progress_per_profile = kb._positive_int(_kanban_cfg.get("max_in_progress_per_profile"), None) # Memory-derived default when unset — same fallback the gateway applies. - max_in_progress = kb.resolve_max_in_progress(kb._positive_int(_kanban_cfg.get("max_in_progress"), None)) + max_in_progress = kb.resolve_max_in_progress( + kb._positive_int(_kanban_cfg.get("max_in_progress"), None) + ) # CLI --max is the more explicit signal, so it wins over kanban.max_spawn. cli_max = getattr(args, "max", None) max_spawn = cli_max if cli_max is not None else kb._positive_int(_kanban_cfg.get("max_spawn"), None) @@ -84,16 +86,9 @@ def _cmd_dispatch(args: argparse.Namespace) -> int: ) if getattr(args, "json", False): _print_json({ - "reclaimed": res.reclaimed, - "crashed": res.crashed, - "timed_out": res.timed_out, - "stale": res.stale, - "auto_blocked": res.auto_blocked, - "promoted": res.promoted, - "spawned": [ - {"task_id": tid, "assignee": who, "workspace": ws} - for (tid, who, ws) in res.spawned - ], + **{k: getattr(res, k) + for k in ("reclaimed", "crashed", "timed_out", "stale", "auto_blocked", "promoted")}, + "spawned": [{"task_id": tid, "assignee": who, "workspace": ws} for (tid, who, ws) in res.spawned], "skipped_unassigned": res.skipped_unassigned, "skipped_nonspawnable": res.skipped_nonspawnable, "skipped_per_profile_capped": [