feat: add orchestrator observability to Mission Control

Add real-time visibility into the parallel orchestrator's decisions
and state in the Mission Control UI. The orchestrator now has its
own avatar ("Maestro") and displays capacity/queue information.

Backend changes (server/websocket.py):
- Add OrchestratorTracker class that parses orchestrator stdout
- Define regex patterns for key orchestrator events (spawn, complete, capacity)
- Track coding/testing agent counts, ready queue, blocked features
- Emit orchestrator_update WebSocket messages
- Reset tracker state when agent stops or crashes

Frontend changes:
- Add OrchestratorState, OrchestratorStatus, OrchestratorEvent types
- Add WSOrchestratorUpdateMessage to WSMessage union
- Handle orchestrator_update in useWebSocket hook
- Create OrchestratorAvatar component (Maestro - robot conductor)
- Create OrchestratorStatusCard with capacity badges and event ticker
- Update AgentMissionControl to show orchestrator above agent cards
- Add conducting/baton-tap CSS animations for Maestro

The orchestrator status card shows:
- Maestro avatar with state-based animations
- Current orchestrator state and message
- Coding agents, testing agents, ready queue badges
- Blocked features count (when > 0)
- Collapsible recent events list

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
Auto
2026-01-23 13:02:36 +02:00
parent b21d2e3adc
commit a03d945fcd
8 changed files with 751 additions and 31 deletions

View File

@@ -2,12 +2,14 @@ import { Rocket, ChevronDown, ChevronUp, Activity } from 'lucide-react'
import { useState } from 'react'
import { AgentCard, AgentLogModal } from './AgentCard'
import { ActivityFeed } from './ActivityFeed'
import type { ActiveAgent, AgentLogEntry } from '../lib/types'
import { OrchestratorStatusCard } from './OrchestratorStatusCard'
import type { ActiveAgent, AgentLogEntry, OrchestratorStatus } from '../lib/types'
const ACTIVITY_COLLAPSED_KEY = 'autocoder-activity-collapsed'
interface AgentMissionControlProps {
agents: ActiveAgent[]
orchestratorStatus: OrchestratorStatus | null
recentActivity: Array<{
agentName: string
thought: string
@@ -20,6 +22,7 @@ interface AgentMissionControlProps {
export function AgentMissionControl({
agents,
orchestratorStatus,
recentActivity,
isExpanded: defaultExpanded = true,
getAgentLogs,
@@ -45,8 +48,8 @@ export function AgentMissionControl({
}
}
// Don't render if no agents
if (agents.length === 0) {
// Don't render if no orchestrator status and no agents
if (!orchestratorStatus && agents.length === 0) {
return null
}
@@ -63,7 +66,14 @@ export function AgentMissionControl({
Mission Control
</span>
<span className="neo-badge neo-badge-sm bg-white text-neo-text ml-2">
{agents.length} {agents.length === 1 ? 'agent' : 'agents'} active
{agents.length > 0
? `${agents.length} ${agents.length === 1 ? 'agent' : 'agents'} active`
: orchestratorStatus?.state === 'initializing'
? 'Initializing'
: orchestratorStatus?.state === 'complete'
? 'Complete'
: 'Orchestrating'
}
</span>
</div>
{isExpanded ? (
@@ -77,25 +87,32 @@ export function AgentMissionControl({
<div
className={`
transition-all duration-300 ease-out overflow-hidden
${isExpanded ? 'max-h-[500px] opacity-100' : 'max-h-0 opacity-0'}
${isExpanded ? 'max-h-[600px] opacity-100' : 'max-h-0 opacity-0'}
`}
>
<div className="p-4">
{/* Orchestrator Status Card */}
{orchestratorStatus && (
<OrchestratorStatusCard status={orchestratorStatus} />
)}
{/* Agent Cards Row */}
<div className="flex gap-4 overflow-x-auto pb-4 scrollbar-thin">
{agents.map((agent) => (
<AgentCard
key={`agent-${agent.agentIndex}`}
agent={agent}
onShowLogs={(agentIndex) => {
const agentToShow = agents.find(a => a.agentIndex === agentIndex)
if (agentToShow) {
setSelectedAgentForLogs(agentToShow)
}
}}
/>
))}
</div>
{agents.length > 0 && (
<div className="flex gap-4 overflow-x-auto pb-4 scrollbar-thin">
{agents.map((agent) => (
<AgentCard
key={`agent-${agent.agentIndex}`}
agent={agent}
onShowLogs={(agentIndex) => {
const agentToShow = agents.find(a => a.agentIndex === agentIndex)
if (agentToShow) {
setSelectedAgentForLogs(agentToShow)
}
}}
/>
))}
</div>
)}
{/* Collapsible Activity Feed */}
{recentActivity.length > 0 && (