pub enum Effect<M = UnitModeProtocol>where
M: ModeProtocol,{
SyncExecutionSurface {
id: EffectId,
update_machine_config: bool,
},
LlmCall {
id: EffectId,
request: Arc<LlmRequest>,
},
CancelLlm {
id: EffectId,
},
ToolCalls {
id: EffectId,
calls: Vec<PendingToolCall>,
},
ExecCode {
id: EffectId,
code: String,
},
Checkpoint {
id: EffectId,
checkpoint: CheckpointKind,
},
Sleep {
id: EffectId,
duration: Duration,
},
Log {
event: LogEvent,
},
Emit(SessionEvent),
Progress {
messages: MessageSequence,
events: Arc<Vec<SessionEventRecord<<M as ModeProtocol>::Event>>>,
mode_iteration: usize,
},
Done {
messages: MessageSequence,
events: Arc<Vec<SessionEventRecord<<M as ModeProtocol>::Event>>>,
mode_iteration: usize,
},
}Expand description
An effect the host must fulfil.
Variants§
SyncExecutionSurface
Sync the live execution surface before the turn proceeds.
update_machine_config is only needed after the turn has
already advanced at least once and the host may need to swap in
a refreshed system prompt or tool schema for the next
mode iteration. Initial syncs are host-only because the machine was
already constructed from a fresh execution surface.
LlmCall
Start an LLM call.
CancelLlm
Cancel an in-progress LLM stream.
ToolCalls
Execute one or more standard-mode tool calls.
ExecCode
Execute a mode-owned code block.
Checkpoint
Run a host/plugin checkpoint before the machine continues or completes.
Sleep
Retry backoff.
Log
Host-implemented fire-and-forget logging.
Emit(SessionEvent)
Fire-and-forget event (no response needed).
Progress
Prompt-history progress that may be durably persisted by the host.
This is separate from SessionEvent: UI stream events can be partial,
duplicated, or display-only, while Progress is emitted only after the
state machine has applied semantic message or mode-step changes.
Done
Turn is done.