pub enum Effect<M = UnitTurnProtocol>where
M: TurnProtocol,{
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,
},
Log {
event: LogEvent,
},
Emit(SessionEvent),
Progress {
messages: MessageSequence,
event_delta: Vec<SessionEventRecord<<M as TurnProtocol>::Event>>,
protocol_iteration: usize,
},
Done {
messages: MessageSequence,
event_delta: Vec<SessionEventRecord<<M as TurnProtocol>::Event>>,
protocol_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
protocol 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 driver-scheduled tool calls.
ExecCode
Execute a protocol-owned code block.
Checkpoint
Run a host/plugin checkpoint before the machine continues or completes.
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 protocol-step changes.
Done
Turn is done.