ExAgent.Steering (ExAgent v3.0.0)

View Source

A handle for live user corrections to one volatile run.

Stability — Candidate.

Pass on_steering: fn handle -> send(ui, {:steering, handle}) end to ExAgent.run/3, ExAgent.run_stream/3 or ExAgent.run_child/4. The callback runs once on admission. Give the handle only to trusted callers. Each child needs its own opt-in. A Server exposes ExAgent.Server.steer_run/3.

Summary

Functions

Returns a specification to start this module under a supervisor.

Wait for a correction to enter canonical history before the next step's request hooks. Returns {:ok, %{correction_id: id, step: n}}. Run this on an independent process so the run, its tools and its stream consumer can advance. A call from the run owner itself returns {:error, :busy}.

Types

receipt()

@type receipt() :: %{step: pos_integer(), correction_id: String.t()}

t()

@opaque t()

Functions

child_spec(init_arg)

Returns a specification to start this module under a supervisor.

See Supervisor.

correct(handle, text)

@spec correct(t(), String.t()) :: {:ok, receipt()} | {:error, term()}

Wait for a correction to enter canonical history before the next step's request hooks. Returns {:ok, %{correction_id: id, step: n}}. Run this on an independent process so the run, its tools and its stream consumer can advance. A call from the run owner itself returns {:error, :busy}.

Up to eight UTF-8 text corrections of at most 16 KiB each can be outstanding. Full returns {:error, :queue_full}. A closed run gives {:error, :run_not_active}. An interrupted application with an unknown outcome gives {:error, :result_unconfirmed}. Guardrail and retention refusals return the underlying reason. An application receipt confirms the input to that step, even if a hook answers it or model admission fails.