Skip to main content

Module coordinator

Module coordinator 

Source
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:

Types defined here:

§Design notes

  • ToolCallRecord is reused from crate::agent rather than duplicated. Failed tool calls land in result as a {"error": "..."} JSON object with success: false, matching pawan’s existing agent loop — there’s no separate error field on the record.
  • ConversationMessage::tool_call_id is only populated on Role::Tool turns 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§

ScheduledTask
One schedulable unit of work for a typed subagent.
ScheduledTaskResult
Outcome of one successfully scheduled task.
TaskScheduleCoordinator
Coordinates validation and sequential dispatch of multi-agent task batches.
ToolCoordinator
Runtime that drives the LLM + tool-calling loop.

Enums§

ScheduleError
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§

TaskRunner
Executes validated ScheduledTask items (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.