Skip to content

feat: active session lanes panel in Flow tab (#721)#2208

Open
vivekchand wants to merge 1 commit into
mainfrom
auto/issue-721-flow-session-lanes
Open

feat: active session lanes panel in Flow tab (#721)#2208
vivekchand wants to merge 1 commit into
mainfrom
auto/issue-721-flow-session-lanes

Conversation

@vivekchand
Copy link
Copy Markdown
Owner

Closes #721

Summary

  • New GET /api/flow/lanes endpoint (routes/infra.py): queries query_flow_runs scoped to the last 30 minutes and returns per-session lane data (channel type, event count, active/failed status). Falls back gracefully to empty list when DuckDB is unavailable.
  • "Active Session Lanes" panel (clawmetry/templates/tabs/flow.html): inserted between the topology SVG and the Live Tool Call Stream. One color-coded pill badge per active session — Telegram blue, WhatsApp green, Slack purple, CLI indigo, etc. Shows channel label, short session ID, and event count.
  • loadFlowLanes() JS function (clawmetry/static/js/app.js): fetches /api/flow/lanes, renders the pill badges, called from initFlow() on page load and refreshed every 30 s via visibilitySetInterval (pauses when tab is hidden to avoid idle polling).

Tradeoff: the lanes are an additive panel below the SVG rather than replacing the static SVG channel nodes. This keeps the diff to 120 LOC and avoids regressions in the existing topology animation. The full per-session SVG lane replacement is a natural follow-up once this data layer is proven.

Test plan

  • Open the Flow tab on a live ClawMetry instance; the "Active Session Lanes" panel should appear between the SVG and the tool stream.
  • With no active sessions in the last 30 min, the panel shows "No active sessions in the last 30 min".
  • Start an OpenClaw session via Telegram; a blue TG badge with the session's short ID and event count appears.
  • Multiple concurrent sessions (e.g., Telegram + WhatsApp) each render their own pill with the correct channel color.
  • After 30 s the panel refreshes automatically.
  • GET /api/flow/lanes returns {"lanes": [...], "_source": "local_store"} when DuckDB is populated.

Generated by Claude Code

Add /api/flow/lanes endpoint returning sessions active within the last
30 minutes, annotated with channel type, event count, and status.

The Flow tab now renders a "Active Session Lanes" panel below the
topology SVG — one color-coded pill badge per active session showing
channel type, short session ID, and event count. Refreshes every 30 s
via visibilitySetInterval so it never fires when the tab is hidden.

No changes to the existing topology SVG or live SSE stream.

Closes #721

Co-Authored-By: Claude <noreply@anthropic.com>
@github-actions
Copy link
Copy Markdown
Contributor

Visual diff

Comparing f78915fda6b2 (head) against the PR base branch.

2 of 38 comparison(s) flagged (>1% pixel diff).

View Before After Diff
desktop overview before after diff · 0.25%
desktop flow ⚠️ before after diff · 100.00%
desktop brain before after diff · 0.00%
desktop usage before after diff · 0.00%
desktop crons before after diff · 0.00%
desktop memory before after diff · 0.00%
desktop security before after diff · 0.00%
desktop subagents before after diff · 0.00%
desktop transcripts before after diff · 0.00%
desktop logs before after diff · 0.00%
desktop skills before after diff · 0.00%
desktop models before after diff · 0.00%
desktop approvals before after diff · 0.00%
desktop alerts before after diff · 0.00%
desktop notifications before after diff · 0.00%
desktop context before after diff · 0.00%
desktop limits before after diff · 0.00%
desktop clusters before after diff · 0.00%
desktop history before after diff · 0.00%
mobile overview before after diff · 0.30%
mobile flow ⚠️ before after diff · 100.00%
mobile brain before after diff · 0.00%
mobile usage before after diff · 0.00%
mobile crons before after diff · 0.00%
mobile memory before after diff · 0.00%
mobile security before after diff · 0.04%
mobile subagents before after diff · 0.00%
mobile transcripts before after diff · 0.03%
mobile logs before after diff · 0.00%
mobile skills before after diff · 0.00%
mobile models before after diff · 0.00%
mobile approvals before after diff · 0.04%
mobile alerts before after diff · 0.00%
mobile notifications before after diff · 0.00%
mobile context before after diff · 0.00%
mobile limits before after diff · 0.00%
mobile clusters before after diff · 0.00%
mobile history before after diff · 0.00%

Folder: pr/2208/f78915fda6b2. Full PNGs also attached as a workflow artefact.

Generated by visual-diff bot. Pixel diffs >1% flagged; eyeball the table before merging. This check is non-blocking — fail = bot bug, not a code problem.

github-actions Bot pushed a commit that referenced this pull request May 28, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Phase 2: Dynamic channel lanes in Flow tab

2 participants