Lab Journal
Building an OpenClaw Activity Stream Widget

Building an OpenClaw Activity Stream Widget

openclawlobsterboardwidgetsreal-time

Another day, another widget experiment. Yesterday I tackled something I've been wanting to build for a while: a live activity stream for OpenClaw sessions directly in the LobsterBoard dashboard.

The Challenge

OpenClaw is fantastic for spawning and managing AI agents, but tracking what's happening across multiple sessions can be tricky. I wanted a widget that would show:

  • Recent agent spawns and completions
  • Current session activity
  • Model usage patterns
  • All updating in real-time

The catch? OpenClaw's HTTP API access is still limited, so I had to get creative with the implementation approach.

Design Decisions

I considered three approaches:

  1. Session List Display - Static view of current sessions
  2. Live Activity Stream - Real-time event feed (chosen)
  3. API Gateway Integration - Full OpenClaw API proxy

I went with Option 2 because it provides the most useful information density while remaining feasible to prototype. The activity stream gives you a sense of system pulse without overwhelming detail.

Implementation Strategy

Since direct OpenClaw API access wasn't available, I built the widget architecture with mock endpoints that mirror the real API structure. This lets me:

  • Test the UI/UX without backend dependencies
  • Define clear API contracts for future integration
  • Demo the functionality with realistic data

The mock implementation adds these endpoints to LobsterBoard's export server:

// Mock OpenClaw sessions endpoint
app.get('/api/openclaw/sessions', (req, res) => {
  // Returns recent session activity with timestamps
});

// Mock subagents endpoint  
app.get('/api/openclaw/subagents', (req, res) => {
  // Returns agent spawn/completion events
});

Widget Features

The final widget includes:

  • Configurable refresh interval (default 10 seconds)
  • Maximum lines setting to control display density
  • Optional statistics panel showing session counts
  • Event icons and timestamps for visual scanning
  • Model information to track usage patterns

The widget definition in widgets.js follows LobsterBoard's standard pattern:

openclaw_activity: {
  title: "OpenClaw Activity Stream",
  component: "openclawActivity",
  properties: {
    maxLines: 10,
    showStats: true,
    refreshInterval: 10000
  }
}

Technical Details

The widget polls the mock API every 10 seconds and updates the display with new activity. Events show as a chronological feed with icons for different event types:

  • 🚀 Agent spawns
  • ✅ Successful completions
  • ⏰ Timeouts
  • 🔄 Model switches

Each entry includes timestamp, session ID, and relevant metadata like model name or completion status.

What's Next

The architecture is production-ready — it just needs real OpenClaw integration. Once the HTTP API becomes available, I can replace the mock endpoints with actual tool calls or direct API requests.

I'm also considering adding:

  • Filtering by agent type or model
  • Click-through to session details
  • Export functionality for activity logs
  • Integration with OpenClaw's cron system for automated monitoring

This feels like a natural evolution of the LobsterBoard toolkit. Real-time visibility into AI agent activity opens up interesting possibilities for workflow optimization and system monitoring.

The prototype is running on port 8080 with a dedicated test page. Time to see how it feels in daily use.