fix: harden WhatsApp target alias salvage

Add a parser-only routing regression that proves raw WhatsApp group JIDs bypass channel-directory resolution and home-channel fallback, include channel_aliases.json in quick state snapshots, harden malformed alias handling, and map Keiron McCammon for release attribution.
This commit is contained in:
Teknium
2026-06-15 05:51:47 -07:00
parent ea49a79633
commit 0d82060c74
6 changed files with 98 additions and 6 deletions
+10
View File
@@ -1199,6 +1199,9 @@ class TestQuickSnapshot:
(home / "config.yaml").write_text("model:\n provider: openrouter\n")
(home / ".env").write_text("OPENROUTER_API_KEY=test-key-123\n")
(home / "auth.json").write_text('{"providers": {}}\n')
(home / "channel_aliases.json").write_text(
'{"whatsapp": {"120363408391911677@g.us": "general"}}\n'
)
(home / "cron").mkdir()
(home / "cron" / "jobs.json").write_text('{"jobs": []}\n')
@@ -1241,6 +1244,13 @@ class TestQuickSnapshot:
snap_id = create_quick_snapshot(hermes_home=hermes_home)
assert (hermes_home / "state-snapshots" / snap_id / "cron" / "jobs.json").exists()
def test_copies_channel_aliases(self, hermes_home):
from hermes_cli.backup import create_quick_snapshot
snap_id = create_quick_snapshot(hermes_home=hermes_home)
copied = hermes_home / "state-snapshots" / snap_id / "channel_aliases.json"
assert copied.exists()
assert "120363408391911677@g.us" in copied.read_text()
def test_missing_files_skipped(self, hermes_home):
from hermes_cli.backup import create_quick_snapshot
snap_id = create_quick_snapshot(hermes_home=hermes_home)