pig/agent/update

Pure agent state machine — the sans-IO update function.

update(state, msg) -> StepResult is a pure function: no provider calls, no tool execution, no telemetry, no hooks.

The runtime calls this function, interprets the returned effect, and feeds results back as new messages.

Values

pub fn update(
  st: state.AgentState,
  m: msg.AgentMsg,
) -> step_result.StepResult

Pure state transition: given current state and a message, return the next state and the effect the runtime should execute, if any.

This is the entire agent loop logic, sans IO.

Search Document