Events
Subscribe to agent events for real-time updates on status changes, conversations, tools, audio, and more.
Overview
The Agent event system provides a type-safe, generic event subscription mechanism that allows you to respond to various agent activities. Events are dispatched through a central EventBus managed by the AgentControlHub.
All events implement the IEvent marker interface, and you can subscribe to any event type using strongly-typed handlers.
Event Categories
Agent Status Events
Track agent lifecycle and status changes:
AgentStatusChanged- Agent status transitions
Conversation Events
Monitor conversation lifecycle:
ConversationCreated- New conversation createdConversationLoaded- Conversation loaded from storageConversationDeleted- Conversation deletedConversationTitleUpdated- Conversation title changedConversationSummaryUpdated- Conversation summary updatedConversationItemsLoaded- Conversation items loadedConversationListLoaded- List of conversations retrieved
Tool Events
Track tool execution lifecycle:
ToolCall- Tool invocation by agentToolStatusEvent- Tool execution status updatesToolOutputEvent- Tool execution resultsMcpApprovalRequest- MCP tool approval request
Audio Events
Monitor audio buffer state:
AudioBufferStateChanged- Audio buffer state transitionsAudioRateLimitsUpdated- Rate limit updates for realtime audio
Delta Events (Streaming)
Real-time streaming updates:
Delta<ITextChunk>- Streaming text updatesDelta<IImageChunk>- Streaming image dataDelta<IAudioChunk>- Streaming audio dataDelta<IAnnotationChunk>- Content annotations
Metadata Events
General agent metadata:
Usage- Token usage informationException- Error events
Quick Start
Basic Event Registration
Multiple Event Handlers
When to Use Events
Use the event system when you need:
✅ Real-time notifications of agent state changes ✅ Monitoring conversation lifecycle ✅ Tracking tool execution ✅ Processing streaming content ✅ Collecting usage metrics ✅ Error handling and logging
Next Steps
Overview - Detailed event system architecture
Registering Events - Registration and lifecycle management
Available Events - Complete event reference
Last updated