Jido.AgentServer.Status
(Jido v2.0.0-rc.4)
View Source
Runtime status for an agent process.
Combines Strategy.Snapshot with process-level metadata to provide a clean,
stable API for querying agent status without depending on internal __strategy__
implementation details.
Fields
agent_module- The agent's module (e.g.,MyAgent)agent_id- The agent's unique IDpid- The GenServer process PIDsnapshot- TheStrategy.Snapshotcontaining core status inforaw_state- Escape hatch containing full agent state (use sparingly)
Usage
{:ok, agent_status} = AgentServer.status(pid)
# Check if completed
if agent_status.snapshot.done? do
IO.puts("Result: " <> inspect(agent_status.snapshot.result))
end
# Access snapshot fields via helpers
case Status.status(agent_status) do
:success -> handle_success(agent_status)
:failure -> handle_failure(agent_status)
:running -> poll_again()
endDelegate Helpers
The module provides convenience delegates to common snapshot fields:
Summary
Functions
Returns active request tuples [{id, status}].
Returns strategy-specific details from the snapshot.
Returns whether the agent has reached a terminal state.
Returns the current iteration count from snapshot details.
Creates a new Status from a map of attributes.
Returns the directive queue length.
Returns the result from the snapshot (if any).
Returns the status from the snapshot (:idle, :running, :waiting, :success, :failure).
Returns the termination reason (e.g., :final_answer, :max_iterations, :error).
Types
Functions
Returns active request tuples [{id, status}].
Returns strategy-specific details from the snapshot.
Returns whether the agent has reached a terminal state.
@spec iteration(t()) :: non_neg_integer() | nil
Returns the current iteration count from snapshot details.
Creates a new Status from a map of attributes.
Returns {:ok, status} or {:error, reason}.
@spec queue_length(t()) :: non_neg_integer()
Returns the directive queue length.
Returns the result from the snapshot (if any).
@spec status(t()) :: Jido.Agent.Strategy.status()
Returns the status from the snapshot (:idle, :running, :waiting, :success, :failure).
Returns the termination reason (e.g., :final_answer, :max_iterations, :error).