fix(outbox): Consumer-Registry zeigt qualname — unterscheidet gleichnamige Handler ueber Plugins hinweg

This commit is contained in:
Agent Zero
2026-09-14 08:29:07 +02:00
parent dcd2018335
commit 591ef06a82
+10 -3
View File
@@ -212,11 +212,18 @@ def _json_payload(payload: dict[str, Any]) -> str:
def _get_handler_name(handler: Any) -> str:
"""Extract a human-readable name from a handler callable."""
name = getattr(handler, "__name__", None)
"""Extract a human-readable name from a handler callable.
Prefers ``__qualname__`` (includes the owning class, e.g.
``AutomationPlugin.on_contact_created``) over ``__name__`` so the
consumer registry distinguishes handlers that share a method name
across plugins (automation/unified_search/system_notif all define
``on_contact_created`` — three distinct handlers, same short name).
"""
name = getattr(handler, "__qualname__", None)
if name:
return name
name = getattr(handler, "__qualname__", None)
name = getattr(handler, "__name__", None)
if name:
return name
return str(handler)