Skip to content

The agent that grows with you

fix(kanban): warn when kanban.dispatch_profiles is present but empty; rename test ids

teknium18994bb6c7589
diff --git a/hermes_cli/kanban_db_dispatch.py b/hermes_cli/kanban_db_dispatch.py
index 0a2b914dce2..935a5a8345d 100644
--- a/hermes_cli/kanban_db_dispatch.py
+++ b/hermes_cli/kanban_db_dispatch.py
@@ -1554,7 +1554,11 @@ def _dispatch_profile_allowlist(normalize_profile_name) -> Optional[frozenset]:
if not isinstance(kanban, Mapping) or "dispatch_profiles" not in kanban:
return None
raw = kanban["dispatch_profiles"]
- if raw is None:
+ if raw is None or (isinstance(raw, str) and not raw.strip()):
+ _kb._log.warning(
+ "kanban: kanban.dispatch_profiles is present but empty — this home "
+ "claims no cards; omit the key to allow any existing profile"
+ )
return frozenset()
names = [str(n) for n in raw] if isinstance(raw, (list, tuple)) else str(raw).split(",")
allowed = set()
diff --git a/tests/hermes_cli/test_kanban_dispatch_claim_allowlist.py b/tests/hermes_cli/test_kanban_dispatch_claim_allowlist.py
index 4b02564c9b3..329fc283cb4 100644
--- a/tests/hermes_cli/test_kanban_dispatch_claim_allowlist.py
+++ b/tests/hermes_cli/test_kanban_dispatch_claim_allowlist.py
@@ -78,20 +78,24 @@ def test_unset_allowlist_keeps_default_claimable(kanban_home, all_assignees_spaw
assert res.skipped_nonspawnable == []
[email protected]("value", ["", None], ids=["blank", "null"])
[email protected]("value", ["", None], ids=["empty_string", "bare_key"])
def test_present_blank_or_null_allowlist_skips_all_cards(
- kanban_home, all_assignees_spawnable, value,
+ kanban_home, all_assignees_spawnable, value, caplog,
):
- """A present key with no names must not fall back to unrestricted claims."""
+ """A present key with no names must not fall back to unrestricted claims,
+ and must say so once in the log so an upgraded home that copied the old
+ ``dispatch_profiles: null`` example is not silently idle (#113620)."""
rendered = "" if value is None else ' ""'
(kanban_home / "config.yaml").write_text(
f"kanban:\n dispatch_profiles:{rendered}\n", encoding="utf-8",
)
- with kbc.connect() as conn:
+ with kbc.connect() as conn, caplog.at_level("WARNING", logger="hermes_cli.kanban_db"):
tid = kb.create_task(conn, title="foreign card", assignee="default")
res = kbd.dispatch_once(conn, dry_run=True)
assert res.spawned == []
assert res.skipped_nonspawnable == [tid]
+ assert any("present but empty" in r.getMessage() and "omit the key" in r.getMessage()
+ for r in caplog.records)
def test_allowlist_config_read_failure_skips_all_cards(