Expand description
Multi-turn tool coordinator — data types and runtime.
Provides a provider-agnostic orchestration layer for agent tool-calling loops: send a prompt with tool definitions, handle tool call requests, execute tools, feed results back, repeat until the model produces a final response or hits an iteration cap.
Types reused from crate::agent:
ToolCallRequest— what the model asks forToolCallRecord— what actually happenedTokenUsage— accumulated counts
Types defined here:
ToolCallingConfig— iteration / parallelism / timeout knobsFinishReason— why the session endedRole— re-exported fromcrate::agent(system/user/assistant/tool)ConversationMessage— a single turn in the historyCoordinatorResult— everything the caller gets backToolCoordinator— the runtime that drives the LLM+tool loopTaskScheduleCoordinator— validates and dispatches multi-agent task batchesScheduledTask/ScheduleError— task scheduling wire types
§Design notes
ToolCallRecordis reused fromcrate::agentrather than duplicated. Failed tool calls land inresultas a{"error": "..."}JSON object withsuccess: false, matching pawan’s existing agent loop — there’s no separateerrorfield on the record.ConversationMessage::tool_call_idis only populated onRole::Toolturns and links the result back to the assistant message that requested it.
Re-exports§
pub use types::*;
Modules§
- types
- Coordinator wire types — ToolCallingConfig, FinishReason, ConversationMessage, CoordinatorResult
Structs§
- Scheduled
Task - One schedulable unit of work for a typed subagent.
- Scheduled
Task Result - Outcome of one successfully scheduled task.
- Task
Schedule Coordinator - Coordinates validation and sequential dispatch of multi-agent task batches.
- Tool
Coordinator - Runtime that drives the LLM + tool-calling loop.
Enums§
- Schedule
Error - Validation / scheduling failure before any task is dispatched.
Constants§
- KNOWN_
AGENT_ TYPES - Subagent types accepted by the task scheduler (aligned with
crate::tools::task::TaskTool).
Traits§
- Task
Runner - Executes validated
ScheduledTaskitems (used by tests and future batch dispatch).
Functions§
- validate_
task_ schedule - Validate a batch before dispatching. Checks non-empty list, known agent types, and unique task ids.