Typed sub-state for tracking tool call concurrency in the Orchestrator.
Replaces flat pending_tool_calls, completed_tool_results,
queued_tool_calls, and max_tool_concurrency fields in Orchestrator Strategy.
Summary
Functions
Adds a call ID to pending (e.g., when an approved call is dispatched).
Returns true when no tool calls are pending or queued.
Returns true if at max concurrency capacity.
Records dispatched call IDs and queued calls, resetting completed results.
Drains queued calls into available concurrency slots.
Adds a call to the queue (e.g., when approved but at capacity).
Returns true when there are pending tool calls.
Creates a new ToolConcurrency state.
Records a completed tool result and removes its call_id from pending.
Splits calls into those to dispatch immediately and those to queue, respecting the concurrency limit.
Types
@type t() :: %Jido.Composer.ToolConcurrency{ completed: [map()], max_concurrency: non_neg_integer() | nil, max_queue_depth: non_neg_integer() | nil, pending: [String.t()], queued: [map()] }
Functions
Adds a call ID to pending (e.g., when an approved call is dispatched).
Returns true when no tool calls are pending or queued.
Returns true if at max concurrency capacity.
Records dispatched call IDs and queued calls, resetting completed results.
Drains queued calls into available concurrency slots.
Returns {updated_state, to_dispatch} where to_dispatch is a list of
call maps ready to be dispatched.
Adds a call to the queue (e.g., when approved but at capacity).
Returns {:ok, state} on success, or {:error, :queue_full} if the queue
has reached max_queue_depth.
Returns true when there are pending tool calls.
Creates a new ToolConcurrency state.
Records a completed tool result and removes its call_id from pending.
Splits calls into those to dispatch immediately and those to queue, respecting the concurrency limit.
Returns {to_dispatch, to_queue}.