Skip to content

The agent that grows with you

fix(kanban): show the resolved dispatch_profiles allowlist in `hermes kanban diagnostics`

teknium16545fb82467f
diff --git a/hermes_cli/kanban.py b/hermes_cli/kanban.py
index 0fee5a0928d..a02f556597d 100644
--- a/hermes_cli/kanban.py
+++ b/hermes_cli/kanban.py
@@ -673,11 +673,18 @@ def _cmd_diagnostics(args: argparse.Namespace) -> int:
tuple(diags_by_task.keys())):
meta[r["id"]] = {k: r[k] for k in ("title", "status", "assignee")}
+ # What this home believes it may claim on a shared board (#113620).
+ allowlist = kbd.dispatch_profile_allowlist_summary()
+
if getattr(args, "json", False):
- _print_json([{"task_id": tid, **meta.get(tid, {}), "diagnostics": [d.to_dict() for d in dl]}
- for tid, dl in diags_by_task.items()])
+ _print_json({
+ "dispatch_profiles": allowlist,
+ "tasks": [{"task_id": tid, **meta.get(tid, {}), "diagnostics": [d.to_dict() for d in dl]}
+ for tid, dl in diags_by_task.items()],
+ })
return 0
+ print(f"kanban.dispatch_profiles: {allowlist}")
if not diags_by_task:
print("No active diagnostics on this board.")
return 0
diff --git a/hermes_cli/kanban_db_dispatch.py b/hermes_cli/kanban_db_dispatch.py
index 935a5a8345d..78157fda4e0 100644
--- a/hermes_cli/kanban_db_dispatch.py
+++ b/hermes_cli/kanban_db_dispatch.py
@@ -1570,6 +1570,26 @@ def _dispatch_profile_allowlist(normalize_profile_name) -> Optional[frozenset]:
return frozenset(allowed)
+def dispatch_profile_allowlist_summary() -> str:
+ """Human-readable resolution of ``kanban.dispatch_profiles`` for this home.
+
+ Surfaced by ``hermes kanban diagnostics`` so an operator on a shared board
+ can see what a home believes it may claim (#113620): ``any`` (key absent),
+ the sorted allowed names, or ``none (fail-closed: ...)``.
+ """
+ try:
+ from hermes_cli.profiles import normalize_profile_name
+ except Exception as exc:
+ return f"none (fail-closed: profiles unavailable: {exc})"
+ allowlist = _dispatch_profile_allowlist(normalize_profile_name)
+ if allowlist is None:
+ return "any"
+ if allowlist:
+ return ", ".join(sorted(allowlist))
+ return ("none (fail-closed: kanban.dispatch_profiles is present but names no valid "
+ "profile, or the config could not be read — omit the key to allow any)")
+
+
def _has_spawnable(conn: sqlite3.Connection, status: str) -> bool:
rows = conn.execute(
"SELECT DISTINCT assignee FROM tasks "
diff --git a/tests/hermes_cli/test_kanban_dispatch_claim_allowlist.py b/tests/hermes_cli/test_kanban_dispatch_claim_allowlist.py
index 329fc283cb4..fe33656181e 100644
--- a/tests/hermes_cli/test_kanban_dispatch_claim_allowlist.py
+++ b/tests/hermes_cli/test_kanban_dispatch_claim_allowlist.py
@@ -113,3 +113,26 @@ def test_allowlist_config_read_failure_skips_all_cards(
res = kbd.dispatch_once(conn, dry_run=True)
assert res.spawned == []
assert res.skipped_nonspawnable == [tid]
+
+
[email protected]("config, expected", [
+ ("", "any"),
+ ("kanban:\n dispatch_profiles: [researcher, sage]\n", "researcher, sage"),
+ ("kanban:\n dispatch_profiles: []\n", "none (fail-closed"),
+], ids=["absent", "listed", "empty_list"])
+def test_diagnostics_reports_resolved_allowlist(kanban_home, capsys, config, expected):
+ """`hermes kanban diagnostics` (text and --json) shows what this home may claim."""
+ import argparse
+ import json
+
+ from hermes_cli import kanban as kanban_cli
+
+ if config:
+ (kanban_home / "config.yaml").write_text(config, encoding="utf-8")
+ assert kanban_cli._cmd_diagnostics(argparse.Namespace(task=None, severity=None, json=False)) == 0
+ text = capsys.readouterr().out
+ assert f"kanban.dispatch_profiles: {expected}" in text
+ assert kanban_cli._cmd_diagnostics(argparse.Namespace(task=None, severity=None, json=True)) == 0
+ payload = json.loads(capsys.readouterr().out)
+ assert payload["dispatch_profiles"].startswith(expected)
+ assert payload["tasks"] == []
diff --git a/website/docs/user-guide/features/kanban.md b/website/docs/user-guide/features/kanban.md
index fdc73a358c2..9466f0a2e1b 100644
--- a/website/docs/user-guide/features/kanban.md
+++ b/website/docs/user-guide/features/kanban.md
@@ -923,7 +923,7 @@ All commands are also available as a slash command in the interactive CLI and in
|------------|---------|--------------|
| `kanban.max_in_progress` | unset (unlimited) | Caps the number of simultaneously running tasks. When the board already has N running, the dispatcher skips spawning more — useful for slow workers (local LLMs, resource-constrained hosts) so they finish what they have before more pile up and time out. Invalid or below-1 values log a warning and behave as unlimited. |
| `kanban.max_in_progress_per_profile` | unset (unlimited) | Per-profile variant of `max_in_progress` — caps how many tasks any single assignee profile may run concurrently. Useful when one profile is slow or rate-limited but others should keep flowing. Applies alongside the board-wide `max_in_progress`; both must allow a spawn for it to proceed. |
-| `kanban.dispatch_profiles` | unset (any existing profile) | Per-home claim allowlist for boards shared across Hermes homes. When the key is present, this home's dispatcher only claims cards whose assignee is listed — fail-closed: an empty list, `null` or a bare `dispatch_profiles:` claims nothing, and a config read that fails logs a warning and claims nothing; other assignees land in `skipped_nonspawnable`. Only omitting the key means "any existing profile". See [Shared boards across homes](#shared-boards-across-homes). |
+| `kanban.dispatch_profiles` | unset (any existing profile) | Per-home claim allowlist for boards shared across Hermes homes. When the key is present, this home's dispatcher only claims cards whose assignee is listed — fail-closed: an empty list, `null` or a bare `dispatch_profiles:` claims nothing, and a config read that fails logs a warning and claims nothing; other assignees land in `skipped_nonspawnable`. Only omitting the key means "any existing profile". `hermes kanban diagnostics` prints the resolved value for this home (`any`, the listed names, or `none (fail-closed: …)`). See [Shared boards across homes](#shared-boards-across-homes). |
| `kanban.auto_promote_children` | `true` | After `decompose_triage_task()` produces children with no parent-blocker dependencies, they're automatically promoted to `ready` so the dispatcher can pick them up. Set to `false` to require manual review — children stay in `todo` until you promote them. |
| `kanban.default_workdir` | unset | Board-level default working directory applied to new tasks when neither `--workspace` nor the task itself overrides it. Per-task `workspace:` still wins. |