session.status
Emitted when the session status changes (thinking, processing, complete).Unique session identifier
Whether the session is actively processing
Human-readable status (e.g., “thinking…”, “running tool”, “complete”)
session.message.appended
Emitted when a new message is added to the conversation history.Message role:
"user", "assistant", or "system"Message text content
session.stream.chunk
Emitted as the AI model streams text output.Text chunk from the model. Append to build the full response.
Whether this is the final chunk in the stream
Stream chunks arrive rapidly. Buffer them and update your UI incrementally.
session.tool.call.started
Emitted when the AI begins executing a tool.Unique identifier for this tool execution
Name of the tool being executed (e.g.,
"bash", "read_file")Input parameters passed to the tool
session.tool.call.completed
Emitted when a tool finishes executing.Whether the tool executed successfully
Tool execution time in milliseconds
session.tool.results
Emitted with the full results from tool execution.Array of tool execution results. Each result includes:
tool_call_id- Matches the ID fromtool.call.startedtool_name- Tool that was executedok- Success statusoutput- Tool-specific output object
session.completed
Emitted when the AI finishes its turn (all streaming and tool calls complete).The complete final message from the AI
Use this event to know when to prompt the user for their next message.
session.interrupted
Emitted when the user cancels an in-progress turn.session.error
Emitted when an error occurs during AI processing.Human-readable error message
Error code for programmatic handling
Typical event sequence
A normal conversation turn emits events in this order:session.status- Status changes to “thinking”session.stream.chunk- Multiple chunks as AI respondssession.tool.call.started- If AI calls a toolsession.tool.call.completed- Tool execution finishessession.tool.results- Tool results availablesession.stream.chunk- AI continues respondingsession.completed- Turn is completesession.status- Status changes to “idle”
Related
- Event system overview - Event format and categories
- Session methods - Creating and managing sessions
- RPC overview - Protocol fundamentals