RunEvent
AgentPrism.Abstractions.dllA single event produced during a run. Events are append-only: they are never updated, only added.
public sealed record RunEvent : IEquatable<RunEvent>Inheritance
Section titled “Inheritance”Implements
Section titled “Implements”Inherited Members
Section titled “Inherited Members”object.GetType(), object.ToString(), object.Equals(object?), object.Equals(object?, object?), object.ReferenceEquals(object?, object?), object.GetHashCode()
Remarks
Section titled “Remarks”RunEvent.Sequence comes from a single writer and increases from 0 within a run. That is what lets live streaming (SSE) and historical replay share one code path; a client can resume from the sequence number it reached when a connection dropped.
Which fields are populated for each event type:
| Value | Fields and meaning |
|---|---|
| RunEventType.RunStarted | Text, the first user message that triggered the run. It is the ONLY place the input text is persisted. |
| RunEventType.MessageDelta | Text |
| RunEventType.ToolInvoking | RunEvent.ToolName, RunEvent.ToolCallId, RunEvent.Payload (arguments) |
| RunEventType.ToolInvoked | RunEvent.ToolName, RunEvent.ToolCallId, RunEvent.Payload (result) |
| RunEventType.ToolFailed | RunEvent.ToolName, RunEvent.ToolCallId, Text (error message) |
| RunEventType.RunFailed | Text (error message) |
Constructors
Section titled “Constructors”RunEvent()
Section titled “ RunEvent()”public RunEvent()Properties
Section titled “Properties”Payload
Section titled “ Payload”Gets the free-form JSON payload that carries tool arguments and results.
public string? Payload { get; init; }Property Value
Section titled “Property Value”Gets the run the event belongs to.
public required Guid RunId { get; init; }Property Value
Section titled “Property Value”Sequence
Section titled “ Sequence”Gets the sequence number within the run. It starts at 0 and increases without gaps.
public required long Sequence { get; init; }Property Value
Section titled “Property Value”TenantId
Section titled “ TenantId”Gets the EXPECTED tenant of the run the event is written to. Defence in depth.
[JsonIgnore]public string? TenantId { get; init; }Property Value
Section titled “Property Value”Remarks
Section titled “Remarks”When populated, the store applies the write only if the target run belongs to that tenant; otherwise the write is dropped and an error is raised. When null no tenant check is made.
This field is not filled from the ambient tenant. TenantId may
deliberately override the ambient tenant — that is how workflows and the job
queue work — and filtering by the ambient value would silently drop legitimate
writes. The value is the tenant known to whoever opened the run.
The field is WRITE-side only: it is not stored in a column, it is only the
WHERE guard of the write. Reading it back would always give null, so it is removed from the transport contract with Serialization.JsonIgnoreAttribute.
Gets the text content. Its meaning depends on the event type.
public string? Text { get; init; }Property Value
Section titled “Property Value”Timestamp
Section titled “ Timestamp”Gets the moment the event occurred (UTC).
public required DateTimeOffset Timestamp { get; init; }Property Value
Section titled “Property Value”ToolCallId
Section titled “ ToolCallId”Gets the tool call id, which separates several calls to the same tool.
public string? ToolCallId { get; init; }Property Value
Section titled “Property Value”ToolName
Section titled “ ToolName”Gets the tool name. Populated only on tool events.
public string? ToolName { get; init; }Property Value
Section titled “Property Value”Gets the event type.
public required RunEventType Type { get; init; }Property Value
Section titled “Property Value”Methods
Section titled “Methods”Equals(object?)
Section titled “ Equals(object?)”public override bool Equals(object? obj)Parameters
Section titled “Parameters”obj object?
Returns
Section titled “Returns”Equals(RunEvent?)
Section titled “ Equals(RunEvent?)”public bool Equals(RunEvent? other)Parameters
Section titled “Parameters”other RunEvent?
Returns
Section titled “Returns”GetHashCode()
Section titled “ GetHashCode()”public override int GetHashCode()Returns
Section titled “Returns”ToString()
Section titled “ ToString()”public override string ToString()Returns
Section titled “Returns”Operators
Section titled “Operators”operator ==(RunEvent?, RunEvent?)
Section titled “ operator ==(RunEvent?, RunEvent?)”public static bool operator ==(RunEvent? left, RunEvent? right)Parameters
Section titled “Parameters”left RunEvent?
right RunEvent?
Returns
Section titled “Returns”operator !=(RunEvent?, RunEvent?)
Section titled “ operator !=(RunEvent?, RunEvent?)”public static bool operator !=(RunEvent? left, RunEvent? right)Parameters
Section titled “Parameters”left RunEvent?
right RunEvent?