Chain-of-Thought strategy delegated to an internal per-parent worker agent.
The parent strategy remains the orchestration boundary while a lazily spawned
child worker (:cot_worker) owns runtime execution and streaming.
Delegation Model
- Parent receives
"ai.cot.query"and prepares worker payload. - Parent lazily spawns internal worker on first request (if needed).
- Parent emits
"ai.cot.worker.start"to worker. - Worker performs one CoT LLM turn and emits
"ai.cot.worker.event"envelopes. - Parent applies worker events to CoT state and preserves external API.
Request Lifecycle Contract
- Runtime worker events are normalized into lifecycle transitions:
request_started,request_completed,request_failed,request_cancelled. - LLM stream events (
llm_started,llm_delta,llm_completed) update snapshot fields and emit canonical lifecycle signals (ai.llm.delta,ai.llm.response,ai.usage). - Concurrency policy defaults to
request_policy: :reject; concurrent requests emitai.request.errorwithreason: :busy. - Request traces are retained in bounded in-memory state (cap: 2000 events per request, then marked truncated).
Summary
Functions
Returns the conclusion from the agent's current state.
Returns the raw LLM response from the agent's current state.
Returns the extracted reasoning steps from the agent's current state.
Returns the legacy action atom for handling streaming LLM partial tokens (no-op in delegated mode).
Returns the legacy action atom for handling LLM results (no-op in delegated mode).
Returns the action atom for handling request rejection events.
Returns the action atom for starting a CoT reasoning session.
Types
Functions
@spec get_conclusion(Jido.Agent.t()) :: String.t() | nil
Returns the conclusion from the agent's current state.
@spec get_raw_response(Jido.Agent.t()) :: String.t() | nil
Returns the raw LLM response from the agent's current state.
@spec get_steps(Jido.Agent.t()) :: [Jido.AI.Reasoning.ChainOfThought.Machine.step()]
Returns the extracted reasoning steps from the agent's current state.
@spec llm_partial_action() :: :cot_llm_partial
Returns the legacy action atom for handling streaming LLM partial tokens (no-op in delegated mode).
@spec llm_result_action() :: :cot_llm_result
Returns the legacy action atom for handling LLM results (no-op in delegated mode).
@spec request_error_action() :: :cot_request_error
Returns the action atom for handling request rejection events.
@spec start_action() :: :cot_start
Returns the action atom for starting a CoT reasoning session.