Events
An event is one thing that happened in a graph. Events are immutable and ordered by id, which sorts by time.
Each event has the payload its agent tool reported, and changes: every node the event changed, and for each, the fields that changed, from what to what. A node’s derived fields count too: an agent being spawned changes its parent’s child_count, and every ancestor’s descendant_count.
List events starting_after the last one you saw to follow a graph cheaply, or with order=asc from any point to replay its history.
Event types
| Type | payload | When |
|---|---|---|
session.started | cwd?, source? (startup, resume, …), title?, link_method? | A session starts or resumes. |
session.ended | reason? | A session exits. |
agent.spawned | agent_type?, purpose?, background? | An agent starts. |
agent.finished | status (completed, failed, canceled), summary? | An agent stops. |
status | state, summary?, title? | A node’s state or status line changes. |
tasks.updated | items: [{id, text, active_text?, status}] | A to-do tool sent its whole list, which replaces the node’s. |
task.upserted | id, text?, active_text?, status? | One task was created or changed. |
task.deleted | id | A task was removed. |
spawn.requested | call_id, kind (agent, session), agent_type?, purpose?, background | A node asked for a child to start. Unless background, it’s blocked until the call returns. |
spawn.returned | call_id, child?, outcome? | That call returned. |
wait.started | wait_id, on (a provider node id), reason? | A node blocked on another for some other reason. |
wait.ended | wait_id, outcome? | That block cleared. |
message.sent | message_id, to, reply_to?, summary?, body? | One node sent another a message. |
activity | tool, label? | A tool call, when the share records them. |
Ids inside payload are the provider’s own (as in provider_ref), exactly as the agent tool reported them; use node_id and changes for API ids. More types may be added: ignore those you don’t recognise.
List events
client.graphs.events.list(stringgraphID, EventListParams { created, ending_before, expand, 7 more } params?, RequestOptionsoptions?): CursorPage<Event { id, changes, created, 7 more } >
GET/graphs/{graph_id}/events
Retrieve an event
client.graphs.events.retrieve(stringeventID, EventRetrieveParams { graph_id, expand } params, RequestOptionsoptions?): Event { id, changes, created, 7 more }
GET/graphs/{graph_id}/events/{event_id}