Skip to main content

AgentEvent

Enum AgentEvent 

Source
pub enum AgentEvent {
Show 39 variants UserTaskSubmitted { text: String, content_parts: Vec<ContentPart>, submitted_at: Option<u64>, }, ModelOutput { text: String, thinking: Option<String>, }, ModelDelta { text: String, }, ModelThinkingDelta { text: String, }, ToolCallStreaming { id: Option<String>, tool_name: String, arguments_chars: usize, }, ToolRequested(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), ApprovalRequested(ApprovalRequest), ApprovalResolved(ApprovalDecision), CapabilityRecorded(CapabilityLedgerEntry), QuestionRequested(QuestionRequest), QuestionResolved(QuestionResponse), PlanReviewRequested(PlanReviewRequest), PlanReviewResolved(PlanReviewResponse), SudoPasswordRequested(SudoPasswordRequest), RepeatedToolCallWarning { tool_name: String, message: String, }, RepetitionDetected { kind: RepetitionWarningKind, message: String, }, Error { message: String, }, AutoDreamStarted { hours_since_last: u64, sessions_reviewed: usize, }, AutoDreamCompleted { marked_stale: usize, duplicates_merged: usize, active_count: usize, }, AutoDreamFailed { reason: String, }, UsageReported { input_tokens: u64, output_tokens: u64, cache_creation_tokens: u64, cache_read_tokens: u64, }, SessionRecap { summary: String, suppressed: bool, }, StreamResuming { accumulated_chars: usize, attempt: u32, }, 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>, }, MicroCompactApplied { messages_cleared: usize, }, AutoCompactStarted, AutoCompactCompleted { tokens_saved: u64, summary: String, kept_recent_messages: usize, }, AutoCompactFailed { reason: String, }, PlanProposed { title: String, steps: Vec<String>, }, AgentModeChanged { mode: AgentMode, }, NotificationRequested { title: String, body: String, urgency: NotificationUrgency, category: Option<String>, }, UpdateAvailable { current_version: String, latest_version: String, latest_tag: String, release_url: String, body: Option<String>, prerelease: bool, },
}
Expand description

A high-level agent event suitable for client consumption.

Unlike RuntimeEventKind, agent events represent the semantic actions a client cares about: user input, model output, tool calls, approvals, compaction, usage, and errors.

Variants§

§

UserTaskSubmitted

The user submitted a new task or message.

Fields

§text: String

The user’s input text.

§content_parts: Vec<ContentPart>

Optional multimodal content parts (images + text).

§submitted_at: Option<u64>

Unix timestamp (seconds since epoch) when the user submitted this message. Used for wall-clock display in clients (e.g. TUI sticky bar). Optional for backward-compatible session JSON (pre-timestamp sessions).

§

ModelOutput

A complete model output with optional thinking/reasoning content.

Fields

§text: String

The assistant’s response text.

§thinking: Option<String>

Optional thinking or reasoning trace from the model.

§

ModelDelta

A streaming text delta from the model.

Fields

§text: String

Incremental text content.

§

ModelThinkingDelta

A streaming thinking/reasoning delta from the model.

Fields

§text: String

Incremental thinking content.

§

ToolCallStreaming

Live-only: the model is streaming tool-call arguments before [ToolRequested]. Not persisted in the session event log.

Fields

§id: Option<String>

Provider tool-call id when known.

§tool_name: String

Tool name when known.

§arguments_chars: usize

Total characters of arguments streamed so far for this call.

§

ToolRequested(ToolInvocation)

The assistant requested a tool invocation.

§

ToolCompleted(ToolResult)

A tool invocation completed.

§

SubagentActivity

Transient status for a nested subagent.

Fields

§invocation_id: String

Parent subagent tool invocation id.

§message: String

Human-readable description of the latest nested activity.

§

SubagentTranscript

Transient drill-down transcript item for a nested subagent.

Fields

§invocation_id: String

Parent subagent tool invocation id.

§item: SubagentTranscriptItem

Transcript item to append for this UI session.

§

HarnessTrace(Value)

A harness-level diagnostic trace.

§

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 was proposed by the assistant.

§

ApprovalRequested(ApprovalRequest)

A tool invocation requires user approval.

§

ApprovalResolved(ApprovalDecision)

An approval request was resolved.

§

CapabilityRecorded(CapabilityLedgerEntry)

A capability lifecycle event was recorded by the policy layer.

§

QuestionRequested(QuestionRequest)

The assistant requested an interactive user choice.

§

QuestionResolved(QuestionResponse)

An interactive user choice was resolved.

§

PlanReviewRequested(PlanReviewRequest)

Plan tool create is waiting for user review (blocks the turn).

§

PlanReviewResolved(PlanReviewResponse)

User finished plan review (approve / changes / quit).

§

SudoPasswordRequested(SudoPasswordRequest)

Bash/sudo needs a password; TUI shows a masked modal. Password is never included in this event — only a correlation id. The secret is delivered solely through the sudo password resolver oneshot.

§

RepeatedToolCallWarning

The same tool was called consecutively with identical arguments. The tool is NOT executed; this is a notification to the user.

Fields

§tool_name: String

Name of the repeated tool.

§message: String

Warning message describing the repetition.

§

RepetitionDetected

Repetitive/degenerate model output was detected (character runs, alternating patterns, or duplicate thinking blocks).

Fields

§kind: RepetitionWarningKind

What kind of repetition was detected.

§message: String

Human-readable warning message.

§

Error

An error occurred.

Fields

§message: String

Human-readable error message.

§

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.

§

UsageReported

Token usage was 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).

§

SessionRecap

Short post-turn session recap (“Recap” line).

Fields

§summary: String

One- or two-sentence summary of the turn.

§suppressed: bool

When true, the recap was generated but should not be shown (long-tail).

§

StreamResuming

The provider stream broke mid-generation and is being resumed via prefill (assistant continuation). The UI can show a transient hint.

Fields

§accumulated_chars: usize

Characters of text accumulated before the break.

§attempt: u32

Retry attempt number (1-based).

§

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

The session goal was updated (created, status change, budget exceeded).

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.

§

MicroCompactApplied

Micro-compaction cleared stale tool results from history.

Fields

§messages_cleared: usize

Number of tool result messages cleared.

§

AutoCompactStarted

Automatic conversation compaction started.

§

AutoCompactCompleted

Automatic conversation compaction completed.

Fields

§tokens_saved: u64

Estimated 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

Automatic conversation compaction failed.

Fields

§reason: String

Human-readable failure reason.

§

PlanProposed

The agent proposed a plan in Plan mode.

Fields

§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

§mode: AgentMode

The new mode.

§

NotificationRequested

Host should surface a user-visible notification.

Desktop hosts call OS toasts; browser hosts map this to the Web Notifications API. Payload mirrors crate::notify::NotifyRequest.

Fields

§title: String
§body: String
§category: Option<String>
§

UpdateAvailable

A newer NAVI release is available (from update check).

Fields

§current_version: String
§latest_version: String
§latest_tag: String
§release_url: String
§prerelease: bool

Trait Implementations§

Source§

impl Clone for AgentEvent

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 AgentEvent

Source§

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

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

impl<'de> Deserialize<'de> for AgentEvent

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 AgentEvent

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