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
content_parts: Vec<ContentPart>Optional multimodal content parts (images + text).
ModelOutput
A complete model output with optional thinking/reasoning content.
Fields
ModelDelta
A streaming text delta from the model.
ModelThinkingDelta
A streaming thinking/reasoning delta from the model.
ToolCallStreaming
Live-only: the model is streaming tool-call arguments before
[ToolRequested]. Not persisted in the session event log.
Fields
ToolRequested(ToolInvocation)
The assistant requested a tool invocation.
ToolCompleted(ToolResult)
A tool invocation completed.
SubagentActivity
Transient status for a nested subagent.
Fields
SubagentTranscript
Transient drill-down transcript item for a nested subagent.
Fields
item: SubagentTranscriptItemTranscript 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
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
RepetitionDetected
Repetitive/degenerate model output was detected (character runs, alternating patterns, or duplicate thinking blocks).
Fields
kind: RepetitionWarningKindWhat kind of repetition was detected.
Error
An error occurred.
AutoDreamStarted
Auto-dream memory consolidation has started.
Fields
AutoDreamCompleted
Auto-dream memory consolidation has completed.
Fields
AutoDreamFailed
Auto-dream memory consolidation has failed.
UsageReported
Token usage was reported by the model provider.
Fields
SessionRecap
Short post-turn session recap (“Recap” line).
Fields
StreamResuming
The provider stream broke mid-generation and is being resumed via prefill (assistant continuation). The UI can show a transient hint.
Fields
SetGoalRequested
The agent requested to set a goal via natural language.
Fields
GoalUpdated
The session goal was updated (created, status change, budget exceeded).
Fields
status: GoalStatusCurrent goal status.
MicroCompactApplied
Micro-compaction cleared stale tool results from history.
AutoCompactStarted
Automatic conversation compaction started.
AutoCompactCompleted
Automatic conversation compaction completed.
Fields
AutoCompactFailed
Automatic conversation compaction failed.
PlanProposed
The agent proposed a plan in Plan mode.
AgentModeChanged
The agent mode changed (e.g. Default → Plan or Plan → Default).
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.
UpdateAvailable
A newer NAVI release is available (from update check).
Trait Implementations§
Source§impl Clone for AgentEvent
impl Clone for AgentEvent
Source§impl Debug for AgentEvent
impl Debug for AgentEvent
Source§impl<'de> Deserialize<'de> for AgentEvent
impl<'de> Deserialize<'de> for AgentEvent
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 AgentEvent
impl RefUnwindSafe for AgentEvent
impl Send for AgentEvent
impl Sync for AgentEvent
impl Unpin for AgentEvent
impl UnsafeUnpin for AgentEvent
impl UnwindSafe for AgentEvent
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