Problem
In GuardEventEmitter.emit_policy_enforced(), when _resolve_agent_id() returns None, the code falls back to str(uuid.UUID(int=0)) (all-zeros UUID 00000000-0000-0000-0000-000000000000).
However, the server's IngestEvent handler explicitly rejects nil UUIDs:
if req.AgentID == uuid.Nil {
response.BadRequest(w, "agentId is required")
return
}
This means events are silently dropped whenever agent resolution fails. The logger.warning on the 400 response surfaces the symptom, but the telemetry data is permanently lost.
Where
capiscio_mcp/events.py — emit_policy_enforced() method, line:
event: Dict[str, Any] = {
...
"agentId": effective_agent_id or str(uuid.UUID(int=0)),
...
}
Suggested fix
Either:
- Skip emission entirely when no valid
agentId can be resolved — log a warning and return early
- Require a valid
agent_id at GuardEventEmitter construction time (fail loudly at setup, not silently per-event)
Option 1 is simpler and maintains the best-effort contract. Option 2 is stricter but catches misconfiguration early.
Context
Introduced on feat/guard-event-emission branch as part of the event payload restructuring.
Problem
In
GuardEventEmitter.emit_policy_enforced(), when_resolve_agent_id()returnsNone, the code falls back tostr(uuid.UUID(int=0))(all-zeros UUID00000000-0000-0000-0000-000000000000).However, the server's
IngestEventhandler explicitly rejects nil UUIDs:This means events are silently dropped whenever agent resolution fails. The
logger.warningon the 400 response surfaces the symptom, but the telemetry data is permanently lost.Where
capiscio_mcp/events.py—emit_policy_enforced()method, line:Suggested fix
Either:
agentIdcan be resolved — log a warning and return earlyagent_idatGuardEventEmitterconstruction time (fail loudly at setup, not silently per-event)Option 1 is simpler and maintains the best-effort contract. Option 2 is stricter but catches misconfiguration early.
Context
Introduced on
feat/guard-event-emissionbranch as part of the event payload restructuring.