ReAct strategy delegated to an internal per-parent worker agent.
The parent strategy remains the public orchestration boundary (ask/await/ask_sync),
while runtime execution is delegated to a lazily spawned child worker tagged
:react_worker.
Delegation Model
- Parent receives
"ai.react.query"and prepares runtime config/context. - Parent lazily spawns internal worker on first request (if needed).
- Parent emits
"ai.react.worker.start"to worker. - Worker streams
Jido.AI.Reasoning.ReActevents and emits"ai.react.worker.event"to parent. - Parent applies runtime events to parent state and emits external lifecycle/LLM/tool signals.
Worker Lifecycle
- Child tag is fixed as
:react_worker. - Single active run is enforced (
:rejectbusy policy). - Worker crash during active request marks the request failed.
- No machine-driven fallback path is retained.
Trace Retention
Parent stores per-request runtime event history in request_traces with a hard cap:
%{request_id => %{events: [event, ...], truncated?: boolean()}}Once 2000 events are stored for a request, truncated? is set to true
and new events are not appended.
Summary
Functions
Returns the action atom for request cancellation.
Returns the canonical action atom for context lifecycle operations.
Returns the action atom for injecting user-style input into an active ReAct request.
Returns the list of currently registered tools for the given agent.
Returns the legacy action atom for handling streaming deltas (no-op in delegated mode).
Returns the legacy action atom for handling LLM results (no-op in delegated mode).
Returns the action atom for registering a tool dynamically.
Returns the action atom for handling request rejections.
Returns the legacy action atom for direct runtime stream events (no-op in delegated mode).
Returns the action atom for updating the base system prompt.
Returns the action atom for updating tool context.
Returns the action atom for starting a ReAct conversation.
Returns the action atom for steering an active ReAct request.
Returns the legacy action atom for handling tool results (no-op in delegated mode).
Returns the action atom for unregistering a tool.
Types
@type config() :: %{ tools: [module()], reqllm_tools: [ReqLLM.Tool.t()], actions_by_name: %{required(String.t()) => module()}, request_transformer: module() | nil, system_prompt: String.t(), model: String.t(), max_iterations: pos_integer(), max_tokens: pos_integer(), streaming: boolean(), base_tool_context: map(), base_req_http_options: list(), base_llm_opts: keyword(), provider_opt_keys_by_string: %{optional(String.t()) => atom()}, request_policy: :reject, stream_timeout_ms: non_neg_integer(), stream_receive_timeout_ms: pos_integer(), stream_timeout_ms: non_neg_integer(), stream_receive_timeout_ms: pos_integer(), tool_timeout_ms: pos_integer(), tool_max_retries: non_neg_integer(), tool_retry_backoff_ms: non_neg_integer(), effect_policy: map(), output: Jido.AI.Output.t() | nil, observability: map(), runtime_adapter: true, runtime_task_supervisor: pid() | atom() | nil, agent_id: String.t() | nil }
Functions
@spec cancel_action() :: :ai_react_cancel
Returns the action atom for request cancellation.
@spec context_modify_action() :: :ai_react_context_modify
Returns the canonical action atom for context lifecycle operations.
@spec inject_action() :: :ai_react_inject
Returns the action atom for injecting user-style input into an active ReAct request.
@spec list_tools(Jido.Agent.t()) :: [module()]
Returns the list of currently registered tools for the given agent.
@spec llm_partial_action() :: :ai_react_llm_partial
Returns the legacy action atom for handling streaming deltas (no-op in delegated mode).
@spec llm_result_action() :: :ai_react_llm_result
Returns the legacy action atom for handling LLM results (no-op in delegated mode).
@spec register_tool_action() :: :ai_react_register_tool
Returns the action atom for registering a tool dynamically.
@spec request_error_action() :: :ai_react_request_error
Returns the action atom for handling request rejections.
@spec runtime_event_action() :: :ai_react_runtime_event
Returns the legacy action atom for direct runtime stream events (no-op in delegated mode).
@spec set_system_prompt_action() :: :ai_react_set_system_prompt
Returns the action atom for updating the base system prompt.
@spec set_tool_context_action() :: :ai_react_set_tool_context
Returns the action atom for updating tool context.
@spec start_action() :: :ai_react_start
Returns the action atom for starting a ReAct conversation.
@spec steer_action() :: :ai_react_steer
Returns the action atom for steering an active ReAct request.
@spec tool_result_action() :: :ai_react_tool_result
Returns the legacy action atom for handling tool results (no-op in delegated mode).
@spec unregister_tool_action() :: :ai_react_unregister_tool
Returns the action atom for unregistering a tool.