agora.fleet.orchestrator
Fleet orchestrator.
Three operating modes:
Orchestrator.single_task()— spawn or find one agent, execute one task, return the result. State machine is bypassed.Orchestrator.run_project()— drive a project through the full phase state machine (INIT → ANALYSIS → ARCHITECTURE → IMPLEMENTATION → TESTING → REVIEW → DONE|loop-back).Orchestrator.run_flow()— instantiate aFlowand thenrun_project.
The orchestrator does not call the LLM or Matrix directly — it composes
Dispatcher,
AgentRuntime,
RoomManager, and
EventDispatcher.
Classes
Top-level run driver: phase state machine + agent dispatch + observer. |
|
Aggregated outcome of one |
|
Outcome of the REVIEW phase poll / human approval. |
- class agora.fleet.orchestrator.ReviewDecision[source]
Bases:
objectOutcome of the REVIEW phase poll / human approval.
approved=Trueadvances the project toDONE.approved=Falsewithreturn_to_phaseset drives the loop-back path — the orchestrator re-opens the targeted phase, resets the relevant tasks toPENDING, and resumes execution.feedbackis surfaced to the next agent’s prompt as a system-authored task comment.- return_to_phase: ProjectPhase | None = None
- __init__(approved, feedback='', return_to_phase=None)
- class agora.fleet.orchestrator.ProjectResult[source]
Bases:
objectAggregated outcome of one
Orchestrator.run_project()call.successis the conjunction of every task’s postcondition outcome plus the review approval.task_resultsis in execution order;total_tokensaggregates input/output token counts (andcost_usdif a metered backend sets it) across all agents.- task_results: list[TaskResult]
- __init__(project, success, task_results=<factory>, total_tokens=<factory>, duration_seconds=0.0, project_room_id='')
- class agora.fleet.orchestrator.Orchestrator[source]
Bases:
objectTop-level run driver: phase state machine + agent dispatch + observer.
The orchestrator does not call the LLM or Matrix directly. It composes
Dispatcher(agent assignment),AgentRuntime(per-task execution),RoomManager(room creation), andEventDispatcher(observer surface).Three entry points:
single_task()for a one-shot,run_project()for a full phase-state-machine run, andrun_flow()to instantiate a declarativeFlowand thenrun_projectit.Per-project work directories live under
work_dir/<project_name>/and are unified with the per-project git repo so auto-hook commits and the framework’s view of artefacts share one tree.- __init__(matrix_client, room_manager, llm_factory, work_dir, homeserver_name='agora.local', max_parallel_agents=3, vram_check=None, *, enable_observer=False, repo_root=None, knowledge_cache_dir=None, ollama_base_url, skip_warmup=False, warmup_deadline=600.0, keep_alive='30m', review_timeout_seconds=300.0, enable_web_fetch=False, fetch_timeout_seconds=30.0, fetch_max_bytes=1048576, fetch_max_text_bytes=16384, auto_hooks_enabled=False, plan_authoring_enabled=False, routed_retry_budget=2, tool_errors='raw', nudge_budget=0, review_budget=0, salvage_budget=0, observer=None)[source]
- get_control(project_room_id)[source]
Return the live
OrchestratorControlfor a given project room, if any.
- async single_task(agent_config, task, project_room_id=None)[source]
Spawn one agent, execute one task, return the result.
- async run_project(name, agents, tasks, review_fn=None, max_loopbacks=2, staged_tasks=None, max_task_retries=0)[source]
Run a project through the state machine.
review_fnis called during REVIEW; the default auto-approves if all task postconditions passed. It may return areturn_to_phaseto trigger a loop-back.staged_tasksmapstask.id→StagedTask. Any task whose id is in the map is routed through theStageRunnerinstead of the one-shotAgentRuntime.execute_task()loop.max_task_retries(default 0) is the number of in-phase retries a task is granted after a failed attempt. 0 preserves legacy behaviour (a single attempt, then the cross-phasemax_loopbacksmachinery takes over). Withmax_task_retries=2each task gets up to 3 total attempts within the same phase; between attempts, auto-learnings and the narration redirect are injected so the retry sees the feedback immediately rather than waiting for the next phase boundary.
- async run_flow(flow, project_name)[source]
Materialise a declarative
Flowthen run it.Equivalent to
instantiate_flow(flow, project_name)followed byrun_project(). Use this when driving Agora from a YAML plan file (flows/*.plan.yaml); userun_projectdirectly when agents and tasks are constructed in code.