Skip to content

Activity monitoring

How to use the real-time activity stream to track task events, desktop status changes, and resource usage.

3 min read

Real-time activity stream

The activity stream is a live feed of everything happening across your desktops and tasks. It uses Server-Sent Events (SSE) to push updates to your browser as they happen. No polling, no refresh needed.

You'll see events like:

  • Task created, started, completed, or failed
  • Desktop started, stopped, or errored
  • Approval requests created
  • Agent responses and command outputs

The stream is in the right panel of the Mission Control dashboard. Each event shows a timestamp, the source desktop, and a summary of what happened.

Event types

EventDescription
task.createdA new task was added to the board
task.startedA task began executing
task.completedA task finished successfully
task.failedA task errored during execution
task.reviewA task entered review status, awaiting approval
task.cancelledA task was manually cancelled
desktop.startedA desktop transitioned to running
desktop.stoppedA desktop was shut down
desktop.errorA desktop encountered an error
approval.createdAn approval request was generated
approval.resolvedAn approval was accepted or rejected

Consuming the activity stream

The activity stream is available at:

GET /api/mission-control/activity/stream

This is an SSE endpoint. In JavaScript:

const eventSource = new EventSource('/api/mission-control/activity/stream', {
  headers: { 'x-api-key': 'your-api-key' }
});

eventSource.onmessage = (event) => {
  const data = JSON.parse(event.data);
  console.log(data.type, data.payload);
};

eventSource.onerror = () => {
  // SSE auto-reconnects by default
  console.log('Connection lost, reconnecting...');
};

Note: if you're using API key authentication, you may need to pass the key as a query parameter since EventSource doesn't support custom headers natively. See API authentication for details.

Metrics dashboard

Beyond the event stream, Mission Control provides aggregate metrics that update in real-time.

Task metrics include total tasks by status (pending, running, review, done, failed, cancelled), completion rate over the last 24 hours, and average task duration.

Resource metrics include CPU usage per desktop and aggregate, RAM usage per desktop and aggregate, and disk usage per desktop.

These are available in the Mission Control overview panel and via the API:

curl https://lebureau.talentai.fr/api/mission-control/overview \
  -H "x-api-key: your-api-key"

The response includes task counts, active desktop count, and resource aggregates.

The activity stream in the dashboard supports filtering by:

  • Desktop -- show events for a specific desktop only
  • Event type -- show only task events, desktop events, or approvals
  • Time range -- focus on recent events or a specific window

Tips

  • Keep the activity stream open while running batch tasks. It is the fastest way to spot failures.
  • Use the metrics dashboard to catch overloaded desktops (high CPU/RAM) before they slow down.
  • The SSE endpoint stays open indefinitely. Your client reconnects automatically if the connection drops.
  • For programmatic monitoring, consume the SSE stream in your scripts to trigger alerts or follow-up tasks based on events.