fix: validate entity_type tag before auto-registering in emit()

This commit is contained in:
Greyson LaLonde
2026-04-03 18:49:23 +08:00
parent 3a08e954e7
commit caaccd748d

View File

@@ -455,7 +455,7 @@ class CrewAIEventsBus:
... # or future.result(timeout=5.0) in sync code
"""
if (
hasattr(source, "entity_type")
getattr(source, "entity_type", None) in ("flow", "crew", "agent")
and id(source) not in self._registered_entity_ids
):
self.register_entity(source)