pub struct AgentOutput {
pub text: String,
pub exit_code: Option<i32>,
pub timed_out: bool,
pub duration_ms: u64,
pub artifacts: Vec<String>,
pub quota: Option<Quota>,
pub dropped: Option<Dropped>,
pub commands: Vec<CommandEvidence>,
pub context_tokens: Option<u64>,
}Expand description
Result of an agent invocation.
Fields§
§text: StringThe agent’s final message, extracted from whatever the CLI printed.
exit_code: Option<i32>Exit status code.
timed_out: boolDid the invocation hit its timeout?
duration_ms: u64Wall-clock duration.
artifacts: Vec<String>Artifact file names, relative to the run’s artifacts/ directory.
quota: Option<Quota>Usage limit or authentication outage, when distinguishable from a normal
failure. None for a normal failure, a timeout, or a CLI we cannot
read — the conservative default.
dropped: Option<Dropped>The CLI hung up on its own stream after the agent had done billed
work. None unless that exact shape was recognised — see
[dropped_stream].
commands: Vec<CommandEvidence>Commands the CLI’s own event stream reported running, see
CommandEvidence. Always empty for a backend this crate does not
currently read structured job events from.
context_tokens: Option<u64>Input-side tokens the CLI reported for this turn - approximately the
size of the context the model just read. None when the CLI reports
no usage (or in a shape this build does not read): unknown, never 0.
See [context_tokens].
Implementations§
Source§impl AgentOutput
impl AgentOutput
Sourcepub fn quota_exhausted(&self) -> bool
pub fn quota_exhausted(&self) -> bool
Does this invocation need machine-side quota or authentication recovery?
Sourcepub fn work_undelivered(&self) -> bool
pub fn work_undelivered(&self) -> bool
Did the agent work and the CLI fail to deliver it?
Worth re-asking, unlike AgentOutput::quota_exhausted: the answer is
in a conversation this process can resume.
Trait Implementations§
Source§impl Clone for AgentOutput
impl Clone for AgentOutput
Source§impl Debug for AgentOutput
impl Debug for AgentOutput
Source§impl<'de> Deserialize<'de> for AgentOutput
impl<'de> Deserialize<'de> for AgentOutput
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 Forget for AgentOutput
impl Freeze for AgentOutputwhere
*const u8 is !null: Freeze,
PhantomData<u8>: Freeze,
PhantomData<String>: Freeze,
PhantomData<CommandEvidence>: Freeze,
impl Move for AgentOutput
impl RefUnwindSafe for AgentOutput
impl Send for AgentOutputwhere
RawVecInner: Send,
impl Sync for AgentOutputwhere
RawVecInner: Sync,
impl Unpin for AgentOutput
impl UnsafeUnpin for AgentOutputwhere
*const u8 is !null: UnsafeUnpin,
PhantomData<u8>: UnsafeUnpin,
PhantomData<String>: UnsafeUnpin,
PhantomData<CommandEvidence>: UnsafeUnpin,
impl UnwindSafe for AgentOutputwhere
RawVecInner: UnwindSafe,
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
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