Planck.Agent.ToolRunner (Planck.Agent v0.1.7)

Copy Markdown View Source

Tracks in-flight tool executions and accumulates their results.

Created at the start of a tool-execution phase and consumed when all tools have reported back. Reset to empty at the end of each turn.

Summary

Functions

Kill all in-flight tool task processes.

Return true when all tool calls have completed.

Mark a tool call as done.

Return an empty runner.

Register a set of running tool tasks.

Types

t()

@type t() :: %Planck.Agent.ToolRunner{
  results: list(),
  running: %{required(String.t()) => %{name: String.t(), pid: pid()}}
}
  • :running — map of call_id => %{name: name, pid: pid} for in-flight tools
  • :results — accumulated {call_id, result} pairs as tools complete

Functions

cancel_all(runner)

@spec cancel_all(t()) :: :ok

Kill all in-flight tool task processes.

done?(runner)

@spec done?(t()) :: boolean()

Return true when all tool calls have completed.

mark_done(runner, call_id, result)

@spec mark_done(t(), String.t(), term()) :: {:ok, t()} | :not_running

Mark a tool call as done.

Returns {:ok, updated_runner} or :not_running when call_id is not in the running set (stale result after an abort).

new()

@spec new() :: t()

Return an empty runner.

start(entries)

@spec start([{String.t(), String.t(), pid()}]) :: t()

Register a set of running tool tasks.