Bugfix: Why were Active Agents never showing in the Command Center t...

Documentation for Sessions

🐛 Bugfix: Why were Active Agents never showing in the Command Center t...

📋 Decision Context

Question:

Why were Active Agents never showing in the Command Center top-right corner?

Task: Implement agent lifecycle tracking in MCP tools for real-time Command Center visualization


🎯 Decision Made

Chosen:

Add commandCenter.agentSpawned(), agentThinking(), and agentCompleted() calls to MCP tools (preflight and log-decision)

Options Considered:


💭 Reasoning

The Command Center UI was complete with agent display panels, backend had agent broadcast methods, frontend had agent WebSocket listeners - but NO MCP TOOLS EVER CALLED AGENT METHODS! The commandCenter service had agentSpawned/agentThinking/agentCompleted methods ready, but preflight.ts and log-decision.ts never used them. Solution: Added complete agent lifecycle to both tools. Preflight spawns a RESEARCH agent ('Gathering context and historical decisions'), log-decision spawns an IMPLEMENT agent ('Processing and storing decision'). Both complete agents with results (conventions count, tier, confidence, etc.) or errors. Agents appear in UI for duration of task, then visible for 10 seconds post-completion. Pattern: spawn → thinking → complete. Zero linter errors. ~31 lines added total.


📁 Files Involved


🔗 Related


Auto-generated by MCP Smart Consolidation