Skip to Content
ReferenceEvents

Events Reference

One ordered log per run. Every managed invocation appends to it, whatever started the run, and status is folded from it rather than stored beside it.

The envelope

Every event carries the same envelope, whatever its kind:

FieldMeaning
vSchema version
kindOne of the kinds below
seqPosition in this run’s log, monotonic from 1
run_idThe run this belongs to
session_idThe session, when the run has one
namespaceThe run’s namespace label
originWhich invocable emitted it
tsWhen the store recorded it
payloadThe kind-specific body, below

seq and ts are assigned by the store, not the producer, so ordering is the store’s to guarantee rather than a caller’s to get right.

Lifecycle

Each of these sets the run’s status. See Lifecycle & Control.

KindPayloadNotes
run.startedinvocable, kind_of_invocable, inputOpens the run
run.completedoutput, usageTerminal. usage is the authoritative total
run.failederror_code, message, retryableTerminal. error_code is closed, so branch on it rather than parsing the message
run.pausedreasonNot terminal, and not waiting on an answer
run.resumedreason, valueSame run_id, seq keeps counting
run.cancelledreasonTerminal
run.interruptedinterrupt_id, reason, payload, thread_id, expected_resumeWaiting on an answer. Not terminal

Control

KindPayloadNotes
control.requestedverb, reasonThe signal was recorded, not that the run has acted on it
control.observedverb, safe_pointThe run reached a safe point and is acting on it

Content

KindPayloadNotes
text.deltamessage_id, textOne streamed fragment
thought.deltamessage_id, textReasoning fragment, a separate channel
message.completedmessage_id, textThe record. Deltas are streaming UX
artifact.createdartifact_id, media_type, uri, sizeA reference to bytes stored elsewhere

Tools and nodes

KindPayloadNotes
tool.call.startedcall_id, tool, argsPaired with the completion by call_id
tool.call.completedcall_id, tool, result_preview, result_size, result_sha256, artifactsA capped preview plus size and hash, never the result itself
node.updatednode, state_patchstate_patch shallow-merges: top-level keys replace

Reporting

Advisory. These describe progress; they never change status.

KindPayloadNotes
status.reportedmessageWhat the run is doing now, in words a person can read
progress.reportedstep, current, totalWhich named stage, optionally counted
usage.reportedmodel, usageOne model call. The total on run.completed wins

Other

KindPayloadNotes
input.appendedinput, sourceMid-turn steering
customname, dataEngine-specific. name must be namespaced

Reading them

async for event in run.events(from_seq=0, follow=True): print(event.seq, event.kind)

An unknown kind is carried rather than rejected, so a reader written today does not break against a log written by a newer release.

from agentdeck.core.events import KNOWN_KINDS, TERMINAL_KINDS

KNOWN_KINDS is the set above. TERMINAL_KINDS is run.completed, run.failed and run.cancelled: seeing one of those means no further events will arrive for that run.