fix(kanban): dispatch --json reports respawn_guarded and other suppression reasons

`hermes kanban dispatch --json` only emitted `spawned` and the skip buckets it
already knew about, so a ready card held by the respawn guard (`active_pr`,
`recent_success`, ...), a quota-released worker, a lost dispatch lock or a
memory-pressure hold all looked like `spawned: []` with no reason. Emit
`respawn_guarded`, `rate_limited`, `skipped_locked` and `memory_pressure`
from the DispatchResult the tick already returns.

Salvaged from #111917 by @KoNit-K. Dropped hunk: the `_ACTIVE_PR_RECOVERY_LANES
= frozenset({"review"})` rename in kanban_db_dispatch.py, which is behaviour-
identical to the existing `lane == "review"` check and does not implement the
role-aware exemption the issue asks for.

Part of #111910
This commit is contained in:
KoNit-K
2026-09-15 11:39:37 -07:00
committed by Teknium
parent f7ea39481a
commit ec64ec0d24
2 changed files with 35 additions and 0 deletions
+7
View File
@@ -105,6 +105,13 @@ def _cmd_dispatch(args: argparse.Namespace) -> int:
for (tid, who, current) in res.skipped_per_profile_capped
],
"auto_assigned_default": res.auto_assigned_default,
"respawn_guarded": [
{"task_id": tid, "reason": reason}
for (tid, reason) in res.respawn_guarded
],
"rate_limited": res.rate_limited,
"skipped_locked": res.skipped_locked,
"memory_pressure": res.memory_pressure,
}, ascii=True)
return 0
print(f"Reclaimed: {res.reclaimed}")