From 2684c86aa22d66b69c3d238a185d162ccdb611e8 Mon Sep 17 00:00:00 2001 From: Gtax2006 Date: Thu, 28 May 2026 00:19:48 +0800 Subject: [PATCH] fix: replace nil UUID fallback with empty string to prevent silent event loss (#23) --- capiscio_mcp/events.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/capiscio_mcp/events.py b/capiscio_mcp/events.py index 4bb32c7..197a834 100644 --- a/capiscio_mcp/events.py +++ b/capiscio_mcp/events.py @@ -151,7 +151,7 @@ def emit_policy_enforced( # See capiscio-server internal/db/models.go for JSON field tags. event: Dict[str, Any] = { "id": str(uuid.uuid4()), - "agentId": effective_agent_id or str(uuid.UUID(int=0)), + "agentId": effective_agent_id or "", # empty string: server will return clear validation error instead of silently dropping the event "traceId": str(uuid.uuid4()), "eventType": self.EVENT_POLICY_ENFORCED, "severity": severity or ("HIGH" if decision == "DENY" else "INFO"),