AgentDeck 6.0 is here: serve one deck over HTTP, AG-UI or the terminal.See what's new
AgentDeckv6.0.6
Reference

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 0
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.

A ctx.invoke child run has no session of its own, so its stored session_id is null. An Observer gets that one field rewritten to the session the child's invoker was started on, so a live consumer can bucket the child under the conversation. Every read of the log returns the null - Run.events(), deck.stream() and GET /runs/{run_id}/events all replay stored rows - so correlate a stored child through run.started.parent_run_id, following it up until a run that has a session, since a nested child's invoker is session-less too.

v is {major: 4, minor: 2}. A reader refuses any other major outright rather than guessing at a wire shape it was never taught, so a log written by another major is read with the release that wrote it or replayed into a new store. There is no migration.

Lifecycle

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

KindPayloadNotes
run.startedinvocable, kind_of_invocable, input, parent_run_idOpens the run. parent_run_id is set on a ctx.invoke child and names the run that invoked it
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

Agents

KindPayloadNotes
agent.changedprevious_agent, next_agentThe active agent changed, after a handoff completed. Never emitted for one requested but failed or refused

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, artifact_id, errorA capped preview plus size and hash, never the result itself

Reporting

Advisory. These describe progress; they never change status.

KindPayloadNotes
reportlevel, message, fieldsWhat the running code said about itself: info, warning and error are prose a person reads, record is a named fact a consumer filters
usage.reportedmodel, usageOne model call. The total on run.completed wins

Other

KindPayloadNotes
input.appendedinput, sourceMid-turn steering
answer.refusedreasonAn answer that was not one of the options the run asked for. The run is still waiting_answer, and the next answer can still land
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 of the same schema major.

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.