pub enum LlmStreamEvent {
TextDelta(String),
ThinkingDelta(String),
ThinkingReplace(String),
ToolCall {
id: String,
name: String,
arguments: Value,
},
Done {
stop_reason: StopReason,
usage: Option<Usage>,
},
Retrying {
attempt: u32,
max: u32,
reason: String,
},
Error {
message: String,
fatal: bool,
},
}Expand description
Internal seam between LLM adapter and agent loop. Not serialized.
Variants§
TextDelta(String)
ThinkingDelta(String)
ThinkingReplace(String)
A complete thinking block (provider restates the whole reasoning after streaming deltas). Replacement semantics: supersedes all thinking accumulated so far in this message — the kernel drops prior thinking blocks instead of appending, so the context never doubles up.
ToolCall
Done
Retrying
The adapter is about to retry a failed connect after a transient error.
attempt is 1-based; advisory — the loop only surfaces it.
Error
Fields
fatal: boolTrue when the failure is of a hard-fatal class (bad request, auth, schema, build/parse) that retrying or re-feeding cannot fix. The loop ends the run on a fatal error; a transient-class error that exhausted its retries (or landed mid-stream after content) is fed back to the model for a corrective turn instead.