Skip to main content

RuntimeEventKind

Enum RuntimeEventKind 

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

Fields

§session_id: String

Unique identifier for the session.

§

TurnStarted

A new turn within the session has started.

Fields

§turn_id: String

Unique identifier for the turn.

§

AssistantDelta

A streaming text delta from the assistant.

Fields

§text: String

Incremental text content.

§

AssistantThinkingDelta

A streaming thinking/reasoning delta from the assistant.

Fields

§text: String

Incremental thinking content.

§

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

§invocation_id: String

Parent subagent tool invocation id.

§message: String

Human-readable description of the latest nested activity.

§

SubagentTranscript

A nested subagent emitted a transient transcript item for UI drill-down.

Fields

§invocation_id: String

Parent subagent tool invocation id.

§item: SubagentTranscriptItem

Transcript 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

§reason: String

Machine-readable stop reason.

§message: String

Human-readable diagnostic.

§tool_name: Option<String>

Tool involved in the stop, when applicable.

§

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

§input_tokens: u64

Number of input/prompt tokens consumed.

§output_tokens: u64

Number of output/completion tokens produced.

§cache_creation_tokens: u64

Number of tokens written to the prompt cache (Anthropic).

§cache_read_tokens: u64

Number of tokens read from the prompt cache (Anthropic).

§

SessionSaved

The session has been persisted to disk.

Fields

§session_id: String

Identifier of the saved session.

§

SessionTitleUpdated

Session display title was assigned or updated (provisional or model-named).

Fields

§session_id: String

Identifier of the session.

§title: String

New display title.

§

TurnCompleted

A turn has completed with a final text response.

Fields

§turn_id: String

Identifier of the completed turn.

§text: String

Final assistant text for the turn.

§

SessionFinished

The session has ended.

Fields

§session_id: String

Identifier of the finished session.

§

MicroCompactApplied

Micro-compaction cleared stale read-only tool results from history.

Fields

§messages_cleared: usize

Number of tool result messages that were cleared.

§

AutoCompactStarted

An automatic conversation compaction has started.

§

AutoCompactCompleted

An automatic conversation compaction has completed.

Fields

§tokens_saved: u64

Estimated number of tokens saved by compaction.

§summary: String

Model-produced summary that replaced older turns.

§kept_recent_messages: usize

Non-system conversation messages retained after the summary.

§

AutoCompactFailed

An automatic conversation compaction has failed.

Fields

§reason: String

Human-readable reason for the failure.

§

AutoDreamStarted

Auto-dream memory consolidation has started.

Fields

§hours_since_last: u64

Hours since the last dream run.

§sessions_reviewed: usize

Number of sessions reviewed.

§

AutoDreamCompleted

Auto-dream memory consolidation has completed.

Fields

§marked_stale: usize

Memories marked stale.

§duplicates_merged: usize

Duplicates merged.

§active_count: usize

Active memories remaining.

§

AutoDreamFailed

Auto-dream memory consolidation has failed.

Fields

§reason: String

Human-readable reason for the failure.

§

SetGoalRequested

The agent requested to set a goal via natural language.

Fields

§objective: String

The objective text.

§short_description: Option<String>

Optional short UI label.

§token_budget: Option<i64>

Optional token budget.

§

GoalUpdated

Fields

§session_id: String

The session this goal belongs to.

§goal_id: String

Unique identifier for the goal.

§objective: String

The objective text.

§short_description: Option<String>

Optional short UI label.

§status: GoalStatus

Current goal status.

§tokens_used: i64

Tokens consumed so far.

§token_budget: Option<i64>

Optional token budget.

§

Error

An error occurred during agent execution.

Fields

§message: String

Human-readable error message.

§

PlanProposed

The agent proposed a plan in Plan mode. The UI should show a confirmation popup to implement or discard.

Fields

§session_id: String

The session that proposed the plan.

§title: String

Title/summary of the plan.

§steps: Vec<String>

Ordered list of steps.

§

AgentModeChanged

The agent mode changed (e.g. Default → Plan or Plan → Default).

Fields

§session_id: String

The session whose mode changed.

§mode: AgentMode

The new mode.

§

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.

Fields

§agent_id: String

Configured ACP agent id (e.g. "devin").

§acp_session_id: String

ACP session id on the external agent.

§update_kind: String

Discriminator for the update kind (agent_message_chunk, tool_call, …).

§update: Value

Full update payload as JSON.

Implementations§

Source§

impl RuntimeEventKind

Source

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

Source§

fn clone(&self) -> Self

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for RuntimeEventKind

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl<'de> Deserialize<'de> for RuntimeEventKind

Source§

fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>
where __D: Deserializer<'de>,

Deserialize this value from the given Serde deserializer. Read more
Source§

impl Serialize for RuntimeEventKind

Source§

fn serialize<__S>(&self, __serializer: __S) -> Result<__S::Ok, __S::Error>
where __S: Serializer,

Serialize this value into the given Serde serializer. Read more

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
where ST: ?Sized, DT: ?Sized,

Source§

impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
where ST: ?Sized, DT: ?Sized,

Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> DeserializeOwned for T
where T: for<'de> Deserialize<'de>,

Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T> Instrument for T

Source§

fn instrument(self, span: Span) -> Instrumented<Self> ⓘ

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
Source§

fn in_current_span(self) -> Instrumented<Self> ⓘ

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> IntoEither for T

Source§

fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ

Converts 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 more
Source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
where F: FnOnce(&Self) -> bool,

Converts 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
Source§

impl<T> MaybeSend for T

Source§

impl<T> PolicyExt for T
where T: ?Sized,

Source§

fn and<P, B, E>(self, other: P) -> And<T, P>
where T: Sized + Policy<B, E>, P: Policy<B, E>,

Create a new Policy that returns Action::Follow only if self and other return Action::Follow. Read more
Source§

fn or<P, B, E>(self, other: P) -> Or<T, P>
where T: Sized + Policy<B, E>, P: Policy<B, E>,

Create a new Policy that returns Action::Follow if either self or other returns Action::Follow. Read more
Source§

impl<T> Read<Exclusive, BecauseExclusive> for T
where T: ?Sized,

Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T> Serialize for T
where T: Serialize + ?Sized,

Source§

fn erased_serialize(&self, serializer: &mut dyn Serializer) -> Result<(), Error>

Source§

fn do_erased_serialize( &self, serializer: &mut dyn Serializer, ) -> Result<(), ErrorImpl>

Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = !

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, !>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<T> WithSubscriber for T

Source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self> ⓘ
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

fn with_current_subscriber(self) -> WithDispatch<Self> ⓘ

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more