Skip to main content

Events

In plain terms

The event bus is a mailbox. When something happens (“run started”, “tool used”, “run finished”), Agentium drops a note in the mailbox. You can listen. You watch with the bus. You steer with hooks. Trying to “approve a tool” by emitting on the bus will not work. Approval has its own API. See Approval.

The smallest example

agent.events is the same object as agent.eventBus.

Listen to everything — onAny

Best attachment point for tracers. You don’t have to list 70 event names.

One bus for the whole process

By default each agent/team/workflow gets its own bus. A tracer on agent A will not see agent B. Share one:
EventBus.resetShared() exists for tests.

Events that actually fire

Prefer this short list (LIFECYCLE_EVENTS): Many older names in AgentEventMap are marked @deprecated and are never emitted. Don’t build products on them. Import the list:

Methods

EventBus.shared — process-wide singleton.

Observability

@agentium/observability already listens to the bus. You usually just call instrument(agent). See Observability.