Skip to content

feat: wire MultiAgentCoordinator into runtime (AgentEngine, API, config) #393

@Aureliolo

Description

@Aureliolo

Summary

The MultiAgentCoordinator is fully implemented and tested (PR #329 from #205) but never wired into the runtime. It exists as a standalone service — no production code path invokes it.

What exists

  • MultiAgentCoordinator with 7-phase pipeline (decompose → route → dispatch → rollup)
  • 4 topology dispatchers (SAS, centralized, decentralized, context-dependent)
  • Wave execution via ParallelExecutor with asyncio.TaskGroup
  • Workspace isolation via git worktrees
  • DecompositionService, TaskRoutingService, TaskAssignmentService
  • Comprehensive unit + integration tests

What's missing

1. AgentEngine integration

  • AgentEngine only handles single-agent execution
  • No coordinator parameter in __init__(), no conditional dispatch
  • Need: detect task complexity or explicit coordination request → delegate to MultiAgentCoordinator.coordinate()

2. API endpoint

  • No REST endpoint to trigger multi-agent coordination
  • Need: POST /api/v1/tasks/{id}/coordinate or similar
  • Need: WebSocket events for coordination progress (phase updates, wave completion)

3. Runtime bootstrap

  • create_app() doesn't instantiate a coordinator
  • No factory method to wire DecompositionService + TaskRoutingService + ParallelExecutor + WorkspaceIsolationService + TaskEngineMultiAgentCoordinator
  • Need: coordinator instantiation from company config at startup

4. Configuration

  • RootConfig has no coordination configuration section
  • Need: topology strategy, workspace isolation settings, concurrency limits in YAML config
  • CoordinationConfig model exists but isn't loaded from company config

5. MessageBus integration

  • Coordination phase events are logged but not published to WebSocket subscribers
  • Dashboard cannot display multi-agent coordination progress

Scope

  • Add coordinator parameter to AgentEngine (optional, for multi-agent dispatch)
  • Create API endpoint for multi-agent coordination
  • Add coordination config to RootConfig YAML schema
  • Bootstrap coordinator in create_app() / company startup
  • Publish coordination events to MessageBus / WebSocket
  • Integration test: boot from YAML → create task via API → multi-agent execution

Context

This is the remaining gap from #205 (wire runtime multi-agent coordination). The coordination layer itself is complete — this is purely a wiring/integration task.

Blocks: #321 (meta: path to 0.2)

Metadata

Metadata

Assignees

No one assigned

    Labels

    prio:highImportant, should be prioritizedscope:large3+ days of workspec:agent-systemDESIGN_SPEC Section 3 - Agent Systemspec:communicationDESIGN_SPEC Section 5 - Communication Architecturespec:task-workflowDESIGN_SPEC Section 6 - Task & Workflow Enginespec:toolsDESIGN_SPEC Section 11 - Tool & Capability Systemtype:featureNew feature implementation

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions