The agent that grows with you
Python aiai-agentai-agentsanthropicchatgptclaudeclaude-codecodexhermeshermes-agentllmnous-researchopenai
fix: reject blank unknown delivery destinations too
Tekniumea2252863067
diff --git a/gateway/delivery.py b/gateway/delivery.pyindex 6357eafef49..6585cfbe1e8 100644--- a/gateway/delivery.py+++ b/gateway/delivery.py@@ -134,7 +134,7 @@ class DeliveryTarget:"""Convert back to string format."""if self.is_origin:return "origin"- if self.unknown_platform:+ if self.unknown_platform is not None:return self.unknown_platformif self.platform == Platform.LOCAL:return "local"@@ -168,7 +168,7 @@ class DeliveryRouter:"""Deliver content to all targets; returns per-target results keyed by target string."""results = {}for target in targets:- if target.unknown_platform:+ if target.unknown_platform is not None:results[target.to_string()] = {"success": False, "error": f"unknown_platform: {target.unknown_platform}"}continuediff --git a/tests/gateway/test_delivery_unknown_target.py b/tests/gateway/test_delivery_unknown_target.pyindex 3ff7623583d..4ce705d1fb7 100644--- a/tests/gateway/test_delivery_unknown_target.py+++ b/tests/gateway/test_delivery_unknown_target.py@@ -9,11 +9,13 @@ from gateway.delivery import DeliveryRouter, DeliveryTarget@pytest.mark.asyncio-async def test_unknown_destination_fails_without_writing_and_local_still_works(tmp_path, monkeypatch):[email protected]("raw", ["MisspelledPlatform:ChatID:ThreadID", "", " "])+async def test_unknown_destination_fails_without_writing_and_local_still_works(tmp_path, monkeypatch, raw):monkeypatch.setenv("HERMES_HOME", str(tmp_path))router = DeliveryRouter(GatewayConfig())- raw = "MisspelledPlatform:ChatID:ThreadID"- result = await router.deliver("must not save", [DeliveryTarget.parse(raw)], job_id="bad")+ target = DeliveryTarget.parse(raw)+ raw = raw.strip()+ result = await router.deliver("must not save", [target], job_id="bad")assert not any(receipt["success"] for receipt in result.values()), resultassert raw in resultassert result[raw]["error"] == f"unknown_platform: {raw}"