agora.fleet.dispatcher

Task → agent assignment.

Simple heuristics: match by explicit name, by role, or pick the least-loaded agent with a matching role. Assignment tracking is in-memory — the orchestrator feeds back completion so loads stay current.

Classes

Dispatcher

class agora.fleet.dispatcher.Dispatcher[source]

Bases: object

__init__(agents)[source]
property agents: list[AgentIdentity]
assign(task)[source]

Resolve a task to an agent.

Preference order: 1. task.agent_id set and matches an agent name → that agent. 2. task.agent_id matches a role name → least-loaded agent with that role. 3. No hint → the single agent (if only one); otherwise raise.

assign_by_name(task, agent_name)[source]
assign_by_role(task, role)[source]
release(agent)[source]

Call when a task finishes so load is decremented.