pub enum TaskEndVariant {
Success,
Unable,
Failed,
Unknown,
}Expand description
Discriminator for EngineEvent::TaskEnd that tells consumers how a
task finished without having to introspect the value payload. Extracted
in #206 (Stream 4 follow-up): before this, a caller had to inspect the
value for a Value::Unable envelope to distinguish “the agent said I
can’t” from a well-typed successful return. Serde-tagged on a "variant"
field so new arms ship without wire-shape churn.
#[serde(other)] on TaskEndVariant::Unknown preserves forward-compat:
a future engine that adds e.g. Partial (#205) still deserializes on
older SDKs — the unknown variant surfaces as Unknown and the stream
keeps flowing. Do not match without a wildcard on this enum.
Variants§
Success
The task produced a well-typed value that passed every stage of the
parse → schema → custom validation pipeline. This is the pre-#206
default and the variant carried when #[serde(default)] fires on
payloads that omit the field entirely (older servers).
Unable
The task’s declared return type was T | Unable and the agent
emitted a canonical {"unable": {...}} envelope. The value field
on EngineEvent::TaskEnd carries the full Value::Unable record
so consumers can render reason/missing/category without re-parsing.
Failed
The task ended with a dispatch-level failure — provider error,
sandbox timeout, OOM kill, schema-validation budget exhausted,
or any other path where the value on EngineEvent::TaskEnd
is a Value::FatalError. Consumers grouping by task can use
this to render a failure UI without inspecting value. Emitted
from the runtime dispatch path; LLM tasks may also adopt it in
a follow-up. Older SDKs that don’t know this variant will see it
as Unknown via #[serde(other)] and behave as today.
Unknown
Catch-all for future variants the SDK doesn’t know yet. #[serde(other)]
routes unknown discriminants here so consumers never crash on a
newer engine — e.g. Partial lands in #205 and an older SDK will
see it as Unknown until its own upgrade.
Trait Implementations§
Source§impl Clone for TaskEndVariant
impl Clone for TaskEndVariant
Source§fn clone(&self) -> TaskEndVariant
fn clone(&self) -> TaskEndVariant
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for TaskEndVariant
impl Debug for TaskEndVariant
Source§impl Default for TaskEndVariant
impl Default for TaskEndVariant
Source§fn default() -> TaskEndVariant
fn default() -> TaskEndVariant
Source§impl<'de> Deserialize<'de> for TaskEndVariant
impl<'de> Deserialize<'de> for TaskEndVariant
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>,
Source§impl PartialEq for TaskEndVariant
impl PartialEq for TaskEndVariant
Source§fn eq(&self, other: &TaskEndVariant) -> bool
fn eq(&self, other: &TaskEndVariant) -> bool
self and other values to be equal, and is used by ==.