pub struct Step {
pub purpose: String,
pub kind: StepKind,
pub action: PlannedAction,
}Expand description
One executable unit inside a batch.
A step wraps exactly one PlannedAction plus the metadata the
agent loop needs: why we’re doing it (for failure reports) and
whether the LLM is required to execute it.
Fields§
§purpose: StringNatural-language description of what this step accomplishes.
Used in FailureReport.failing_step and in LLM-assisted retry
prompts as “you are trying to: {purpose}”.
kind: StepKindTells the executor whether it can run the step without an LLM
call at all. Deterministic steps (e.g. a navigate to a known
URL, a wait, a shell-style activate_app) skip the LLM. That is
the biggest latency win — every deterministic step saves a full
plan round-trip.
Tolerant to LLM drift: if the model emits an unknown value
(e.g. confuses the step-level kind with the action-level
type and writes "kind": "cdp_eval"), we default to
Deterministic rather than failing the whole batch parse.
That’s right almost always — the action itself carries the
real semantics — and it’s robust to prompt drift.
action: PlannedActionThe action to execute.