Phase 2 · Batch 4: Live Feed and Activity Correlation #33

Closed
opened 2026-05-20 19:49:07 -05:00 by null · 1 comment
Owner

Outcome

Runtime messages appear as an operator-friendly live activity feed.

Scope

  • Reuse/mirror stream patterns in frontend/src/app/activity/page.tsx
  • Add backend stream endpoint in backend/app/api/activity.py or new runtime activity route
  • Add parser/watcher logic in backend/app/services/openclaw/runtime_usage.py or new runtime_activity.py
  • Add tests under backend/tests/test_runtime_activity*.py

Implementation Details

  • Server-side watcher or polling reader over recent session JSONL offsets
  • Reuse MC existing stream conventions, not copy the Node SSE implementation
  • Normalize message events into role, session label, model, content preview, timestamp, optional task/agent correlation
  • Add as page/tab under Activity, not crowding the dashboard
  • Event redaction for sensitive tool args

Reference

  • server.js: watchSessionFile, startLiveWatcher, broadcastLiveEvent, formatLiveEvent, /api/live
  • index.html: live feed rendering, search/highlight, auto-refresh, SSE handling

Depends On

  • #30 (Batch 1: Read-only Usage Core)

Labels

phase-2, backend, frontend, priority-medium

## Outcome Runtime messages appear as an operator-friendly live activity feed. ## Scope - Reuse/mirror stream patterns in `frontend/src/app/activity/page.tsx` - Add backend stream endpoint in `backend/app/api/activity.py` or new runtime activity route - Add parser/watcher logic in `backend/app/services/openclaw/runtime_usage.py` or new `runtime_activity.py` - Add tests under `backend/tests/test_runtime_activity*.py` ## Implementation Details - Server-side watcher or polling reader over recent session JSONL offsets - Reuse MC existing stream conventions, not copy the Node SSE implementation - Normalize message events into role, session label, model, content preview, timestamp, optional task/agent correlation - Add as page/tab under Activity, not crowding the dashboard - Event redaction for sensitive tool args ## Reference - `server.js`: watchSessionFile, startLiveWatcher, broadcastLiveEvent, formatLiveEvent, /api/live - `index.html`: live feed rendering, search/highlight, auto-refresh, SSE handling ## Depends On - #30 (Batch 1: Read-only Usage Core) ## Labels phase-2, backend, frontend, priority-medium
Author
Owner

Verification Complete

Batch 4 scope verified against docs/runtime-usage-dashboard-plan.md.

Implementation matches plan:

  • Frontend: Runtime tab in activity/page.tsx with RuntimeActivityFeed component
  • Backend stream: /api/v1/gateways/{gateway_id}/runtime-activity/stream in gateways.py
  • Service: runtime_activity.py with message normalization, redaction, and session correlation
  • Tests: test_runtime_activity.py covering all service functions

Minor correction to issue:

  • Backend endpoint is in gateways.py, not activity.py as suggested

Dependencies: #30 (Batch 1) marked correctly — status: closed/complete

Verdict: APPROVED — ready to close.

✅ **Verification Complete** Batch 4 scope verified against `docs/runtime-usage-dashboard-plan.md`. **Implementation matches plan:** - ✅ Frontend: Runtime tab in `activity/page.tsx` with `RuntimeActivityFeed` component - ✅ Backend stream: `/api/v1/gateways/{gateway_id}/runtime-activity/stream` in `gateways.py` - ✅ Service: `runtime_activity.py` with message normalization, redaction, and session correlation - ✅ Tests: `test_runtime_activity.py` covering all service functions **Minor correction to issue:** - Backend endpoint is in `gateways.py`, not `activity.py` as suggested **Dependencies:** #30 (Batch 1) marked correctly — status: closed/complete **Verdict: APPROVED** — ready to close.
null closed this issue 2026-05-20 21:07:53 -05:00
Sign in to join this conversation.
No description provided.