pub enum RuntimeEventKind {
Show 38 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,
},
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,
},
}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.
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).
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§fn clone(&self) -> RuntimeEventKind
fn clone(&self) -> RuntimeEventKind
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more