# Mission Control — Future Improvements

**This document tracks potential future enhancements for Mission Control.**

**Last Updated:** 2026-05-10  
**Current Version:** v0.0.4

## How to Use This Document

This file is a living document. Agents should:
1. Read this file before proposing changes
2. Add new recommendations with priority levels
3. Never add completed items — move those to HISTORY.md instead
4. Reference this file when dispatching improvement tasks
5. Only Ripley can remove items from this list.

### Priority Format

All items must include the priority emoji in their heading, matching the section they belong to:

| Priority | Emoji | Heading Format |
|----------|-------|---------------|
| CRITICAL | 🔴 | `### 🔴 Title — CRITICAL` |
| HIGH | 🟠 | `### 🟠 Title — HIGH` |
| MEDIUM | 🟡 | `### 💡 Title — MEDIUM` |
| LOW | 🔵 | `### 🔵 Title — LOW` |
| NICE TO HAVE | 💭 | `### 💭 Title — NICE TO HAVE` |

Items are grouped under their priority section heading (`## 🔴 CRITICAL`, `## 🟠 HIGH`, etc.) and sorted most-impactful-first within each tier.

---

## Pending Recommendations

### 🟠 HIGH

### 🟠 Gateway Data Collection Service — HIGH
**Priority:** HIGH  
**Status:** DONE ✅  
**Added:** 2026-05-10 by Ripley
**Completed:** 2026-05-11

GatewayCollectorService created in `src/backend/app/services/monitoring/`. Background asyncio task polls gateway RPC endpoints (cost, cron, sessions, health) and upserts into monitoring models. Configurable intervals via env vars. Startup/shutdown integrated into main.py lifespan.

### 🟠 Monitoring Database Models — HIGH
**Priority:** HIGH  
**Status:** DONE ✅  
**Added:** 2026-05-10 by Ripley
**Completed:** 2026-05-11

All 7 models created, migrated, CASCADE + composite indexes verified in running DB. Committed as v0.0.3.

**Description:**
Create new PostgreSQL models for tracking data (cost, sessions, crons, system health, alerts).

**Implementation Notes:**
- CostSnapshot, CronJobStatus, SessionEvent, SubAgentRun, SystemHealthMetric, AlertRule
- Alembic migration for all new tables
- CRUD API endpoints under `/api/monitoring/`

### 🟠 WebSocket for Agent Events — HIGH
**Priority:** HIGH  
**Status:** PENDING  
**Added:** 2026-05-10 by Ripley

**Description:**
Add FastAPI WebSocket endpoint for real-time agent event broadcasting, porting the JSONL session watcher from pixel-agents.

**Implementation Notes:**
- Port `sessionWatcher.ts` logic to Python
- Watch `~/.openclaw/agents/*/sessions/*.jsonl`
- Parse events and broadcast via WebSocket
- Front-end client in `agent-events.ts`

---

### 🟡 MEDIUM

### 🟠 Monitoring API Endpoints — HIGH
**Priority:** HIGH  
**Status:** DONE ✅  
**Added:** 2026-05-11 by Ripley
**Completed:** 2026-05-11

10 read-only endpoints at /api/v1/monitoring/* with org-scoping, pagination, and filtering. Schemas in app/schemas/monitoring.py, router in app/api/monitoring.py.

### 🟠 Dashboard Logic Port — HIGH
**Priority:** HIGH  
**Status:** PENDING  
**Added:** 2026-05-11 by Ripley

**Description:**
Port the Go dashboard's data-processing logic that we're NOT yet reusing — model name normalization, daily cost charting, alert threshold computation, and token formatting.

**Implementation Notes:**
- The Go source (`sources/dashboard-tracking/internal/apprefresh/`) has significant logic beyond raw collection:
  - `ModelName()` — maps raw provider/model strings (e.g. `anthropic/claude-opus-4-6`) to display names ("Claude Opus 4.6")
  - `BuildDailyChart()` — aggregates cost/token data into daily buckets for chart rendering
  - `BuildAlerts()` — evaluates cost thresholds, cron failures, context usage, and gateway health against configurable rules
  - `FmtTokens()` — formats raw token counts (1,234,567 → "1.2M")
  - `BuildCostBreakdown()` — organizes per-model cost into ranked lists
- We're already reusing the **gateway RPC layer** (same transport) and **data model shapes** (same fields)
- What we're NOT reusing is the **processing/aggregation logic** — currently the collector just stores raw data
- This must be ported as Python utility functions before building the monitoring frontend, so the API endpoints can serve pre-computed charts and alerts
- Create `src/backend/app/services/monitoring/data_processing.py` for this logic
- Also port `sources/dashboard-tracking/system_types.go` and `system_service.go` for system health data normalization

### 🟡 Cost Tracking UI — MEDIUM
**Priority:** MEDIUM  
**Status:** PENDING  
**Added:** 2026-05-10 by Ripley

**Description:**
Port the dashboard's cost cards, donut charts, and trend lines to React/Recharts components.

**Implementation Notes:**
- Today's cost, all-time cost, projected monthly
- Per-model cost breakdown (7d/30d/all-time tabs)
- Cost trend line chart (SVG → Recharts)
- Theme-aware styling

### 🟡 Session & Sub-Agent UI — MEDIUM
**Priority:** MEDIUM  
**Status:** PENDING  
**Added:** 2026-05-10 by Ripley

**Description:**
Active sessions with model, type badges, context % bars, sub-agent activity grid.

**Implementation Notes:**
- Session list with filtering (model, type, status)
- Context % bars, token counts
- Sub-agent activity grid with cost/duration/status
- Session detail panel with conversation preview

### 🟡 Cron Job Management — MEDIUM
**Priority:** MEDIUM  
**Status:** PENDING  
**Added:** 2026-05-10 by Ripley

**Description:**
Cron job list with schedule, status, run history. Trigger manual runs from UI.

**Implementation Notes:**
- List, add, edit, delete cron jobs via gateway RPC
- Run history with duration and status badges
- Manual trigger button
- Uses existing `cron.*` gateway RPC methods

### 🟡 System Health Dashboard — MEDIUM
**Priority:** MEDIUM  
**Status:** PENDING  
**Added:** 2026-05-10 by Ripley

**Description:**
Gateway status, CPU/RAM/disk gauges, alert banners with configurable thresholds.

**Implementation Notes:**
- Gateway uptime, PID, memory, compaction status
- CPU/RAM/swap/disk gauge cards
- Alert banner for high cost, failed crons, gateway offline
- Auto-refresh with countdown timer

---

### 🔵 LOW

### 🔵 AI Chat Panel — LOW
**Priority:** LOW  
**Status:** PENDING  
**Added:** 2026-05-10 by Ripley

**Description:**
Port the dashboard's AI chat to a React component that uses OpenClaw gateway's `/v1/chat/completions`.

**Implementation Notes:**
- Context-aware: feed live monitoring data into system prompt
- Persistent chat history per user
- Streaming responses

### 🔵 Theme System Merge — LOW
**Priority:** LOW  
**Status:** PENDING  
**Added:** 2026-05-10 by Ripley

**Description:**
Port the 6 dashboard themes into Mission Control's Tailwind config.

**Implementation Notes:**
- Map dashboard's 19 CSS color variables to Tailwind config
- Theme picker in header (persists via localStorage)
- Glass morphism effects where appropriate

### 🔵 Engineering Reference Manual — LOW
**Priority:** LOW  
**Status:** PENDING — Requires explicit user initiation  
**Added:** 2026-05-10 by Ripley

**Description:**
Comprehensive engineering reference manual documenting the full system architecture, API endpoints, data models, frontend pages/components, and infrastructure.

**Implementation Notes:**
- ⚠️ This task requires explicit initiation by the user. Do not create the Engineering Reference Manual unless specifically asked.
- Should document: system architecture, tech stack, all API endpoints, data models, frontend structure, Docker setup, auth flows
- Bishop would own this task when initiated

---

### 💭 NICE TO HAVE

### 💭 Pixel Agent Canvas — NICE TO HAVE
**Priority:** NICE TO HAVE  
**Status:** PENDING  
**Added:** 2026-05-10 by Ripley

**Description:**
Port the pixel-art office scene with agent sprites, activity bubbles, and day/night cycle to React Canvas.

**Implementation Notes:**
- Use `useRef` + `requestAnimationFrame` for animation, not React state
- Agent sprites with activity state (working, idle, talking)
- Activity bubbles showing current task/conversation
- Conversation heat glow based on recent activity
- Pan/zoom controls (touch + mouse)

### 💭 Hardware Monitor & Service Controls — NICE TO HAVE
**Priority:** NICE TO HAVE  
**Status:** PENDING  
**Added:** 2026-05-10 by Ripley

**Description:**
Server rack component for hardware gauges, breaker panel for gateway start/stop/restart.

**Implementation Notes:**
- CPU/GPU/RAM/disk/network gauges
- Gateway start/stop/restart controls
- Update checker (ham radio component)
- All via gateway RPC methods