pub enum RuntimeEventKind {
Show 39 variants
SessionStarted {
session_id: String,
},
TurnStarted {
turn_id: String,
},
AssistantDelta {
text: String,
},
AssistantThinkingDelta {
text: String,
},
ToolRequested(ToolInvocation),
ApprovalRequired(ApprovalRequest),
ApprovalResolved(ApprovalDecision),
CapabilityRecorded(CapabilityLedgerEntry),
QuestionRequired(QuestionRequest),
QuestionResolved(QuestionResponse),
PlanReviewRequired(PlanReviewRequest),
PlanReviewResolved(PlanReviewResponse),
SudoPasswordRequired(SudoPasswordRequest),
ToolStarted(ToolInvocation),
ToolCompleted(ToolResult),
SubagentActivity {
invocation_id: String,
message: String,
},
SubagentTranscript {
invocation_id: String,
item: SubagentTranscriptItem,
},
HarnessTrace(Value),
HarnessStopped {
reason: String,
message: String,
tool_name: Option<String>,
},
PatchProposed(PatchProposal),
ContextUpdated,
TokensUpdated {
input_tokens: u64,
output_tokens: u64,
cache_creation_tokens: u64,
cache_read_tokens: u64,
},
SessionSaved {
session_id: String,
},
SessionTitleUpdated {
session_id: String,
title: String,
},
TurnCompleted {
turn_id: String,
text: String,
},
SessionFinished {
session_id: String,
},
MicroCompactApplied {
messages_cleared: usize,
},
AutoCompactStarted,
AutoCompactCompleted {
tokens_saved: u64,
summary: String,
kept_recent_messages: usize,
},
AutoCompactFailed {
reason: String,
},
AutoDreamStarted {
hours_since_last: u64,
sessions_reviewed: usize,
},
AutoDreamCompleted {
marked_stale: usize,
duplicates_merged: usize,
active_count: usize,
},
AutoDreamFailed {
reason: String,
},
SetGoalRequested {
objective: String,
short_description: Option<String>,
token_budget: Option<i64>,
},
GoalUpdated {
session_id: String,
goal_id: String,
objective: String,
short_description: Option<String>,
status: GoalStatus,
tokens_used: i64,
token_budget: Option<i64>,
},
Error {
message: String,
},
PlanProposed {
session_id: String,
title: String,
steps: Vec<String>,
},
AgentModeChanged {
session_id: String,
mode: AgentMode,
},
AcpPeerUpdate {
agent_id: String,
acp_session_id: String,
update_kind: String,
update: Value,
},
}Expand description
Discriminates the kind of runtime event emitted by the agent loop.
Variants cover the full session lifecycle from start through turn execution, tool invocation, approval flow, compaction, and error reporting.
Variants§
SessionStarted
A new session has been created.
TurnStarted
A new turn within the session has started.
AssistantDelta
A streaming text delta from the assistant.
AssistantThinkingDelta
A streaming thinking/reasoning delta from the assistant.
ToolRequested(ToolInvocation)
The assistant has requested a tool invocation.
ApprovalRequired(ApprovalRequest)
A tool invocation requires user approval before execution.
ApprovalResolved(ApprovalDecision)
An approval request has been resolved (approved or denied).
CapabilityRecorded(CapabilityLedgerEntry)
A capability lifecycle event was recorded by the policy layer.
QuestionRequired(QuestionRequest)
The assistant has requested an interactive user choice.
QuestionResolved(QuestionResponse)
An interactive user choice has been resolved.
PlanReviewRequired(PlanReviewRequest)
Plan tool create is waiting for user review (blocks the turn).
PlanReviewResolved(PlanReviewResponse)
User finished plan review.
SudoPasswordRequired(SudoPasswordRequest)
Sudo password needed (no secret in event payload).
ToolStarted(ToolInvocation)
A tool invocation has begun execution.
ToolCompleted(ToolResult)
A tool invocation has completed.
SubagentActivity
A nested subagent emitted a transient UI activity update.
Fields
SubagentTranscript
A nested subagent emitted a transient transcript item for UI drill-down.
Fields
item: SubagentTranscriptItemTranscript item to append for the active UI session.
HarnessTrace(Value)
A harness-level diagnostic trace (profile, message count, tool count).
HarnessStopped
The harness stopped a turn before another model iteration.
Fields
PatchProposed(PatchProposal)
A file patch has been proposed by the assistant.
ContextUpdated
The conversation context has been updated.
TokensUpdated
Token usage has been reported by the model provider.
Fields
SessionSaved
The session has been persisted to disk.
SessionTitleUpdated
Session display title was assigned or updated (provisional or model-named).
TurnCompleted
A turn has completed with a final text response.
Fields
SessionFinished
The session has ended.
MicroCompactApplied
Micro-compaction cleared stale read-only tool results from history.
AutoCompactStarted
An automatic conversation compaction has started.
AutoCompactCompleted
An automatic conversation compaction has completed.
Fields
AutoCompactFailed
An automatic conversation compaction has failed.
AutoDreamStarted
Auto-dream memory consolidation has started.
Fields
AutoDreamCompleted
Auto-dream memory consolidation has completed.
Fields
AutoDreamFailed
Auto-dream memory consolidation has failed.
SetGoalRequested
The agent requested to set a goal via natural language.
Fields
GoalUpdated
Fields
status: GoalStatusCurrent goal status.
Error
An error occurred during agent execution.
PlanProposed
The agent proposed a plan in Plan mode. The UI should show a confirmation popup to implement or discard.
Fields
AgentModeChanged
The agent mode changed (e.g. Default → Plan or Plan → Default).
AcpPeerUpdate
Progress from an external ACP agent peer (not a model provider).
Text deltas from ACP are also emitted as [AssistantDelta] when
applicable; this variant carries the full peer update for clients that
want tool/plan/permission detail from the external agent.
Implementations§
Source§impl RuntimeEventKind
impl RuntimeEventKind
Sourcepub fn into_agent_event(self) -> Option<AgentEvent>
pub fn into_agent_event(self) -> Option<AgentEvent>
Converts this event kind into an AgentEvent if applicable.
Returns None for lifecycle-only events that have no direct
agent-level counterpart (session/turn lifecycle, tool started,
context updated).
Trait Implementations§
Source§impl Clone for RuntimeEventKind
impl Clone for RuntimeEventKind
Source§impl Debug for RuntimeEventKind
impl Debug for RuntimeEventKind
Source§impl<'de> Deserialize<'de> for RuntimeEventKind
impl<'de> Deserialize<'de> for RuntimeEventKind
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Auto Trait Implementations§
impl Freeze for RuntimeEventKind
impl RefUnwindSafe for RuntimeEventKind
impl Send for RuntimeEventKind
impl Sync for RuntimeEventKind
impl Unpin for RuntimeEventKind
impl UnsafeUnpin for RuntimeEventKind
impl UnwindSafe for RuntimeEventKind
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> DeserializeOwned for Twhere
T: for<'de> Deserialize<'de>,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
Source§fn in_current_span(self) -> Instrumented<Self> ⓘ
fn in_current_span(self) -> Instrumented<Self> ⓘ
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more