Skip to content

feat(sessions): show live OpenClaw and Hermes chats on Sparks - #46

Open
kesslerio wants to merge 9 commits into
MiaAI-Lab:mainfrom
kesslerio:feat/llm-session-transparency
Open

feat(sessions): show live OpenClaw and Hermes chats on Sparks#46
kesslerio wants to merge 9 commits into
MiaAI-Lab:mainfrom
kesslerio:feat/llm-session-transparency

Conversation

@kesslerio

Copy link
Copy Markdown
Contributor

Closes #4
Related: #2
Related: #3

TL;DR

The Spark LLM panel now lists OpenClaw and Hermes Agent chats bound to that node's listen address, with generating / stalled / unknown. Generating is mid-turn plus origin match. Recency, GPU busy, and Showcase streaming do not light the badge.

What Problem This Solves

The LLM card already shows model id, slots, and tok/s. It does not name the chats using that node. People bounce to OpenClaw or Hermes to guess occupancy, and a chat can look live while the Spark is idle.

Why This Change Was Made

Attach sources once in Settings (local conventional state, a state dir, or a URL). Project rows by provider baseUrl host+port onto each Spark's lanIp / loopback and llmPorts. OpenClaw uses hasActiveRun. Hermes is_active stays unknown unless status is working/running. Occupancy is a snapshot conversations list, not LlmMetrics. Tokens stay in the secrets store; GET only reports hasToken. Changing the URL origin without a new token clears the stored token.

Session-settled from planning: conversations over engine slot lists (user-directed); per-chat generating over node-busy (user-directed); unknown over guessed generating (user-directed); conventional paths plus remote state dir/URL (user-approved); mid-turn without HTTP-in-flight (user-directed).

User Impact

On an llmOn Spark, a bound mid-turn chat shows as generating, then stalled when the turn ends. Missing sources hide the list. The existing probe still works. Workers still have no LLM card.

Risk and Rollout

Low for the current LLM panel: empty/disabled/worker omit conversations. Additive snapshot field.

Must not happen: token on GET/WS, generating from 5-minute recency, transcripts on the snapshot, fleet-specific state paths.

OpenClaw URL mode still HTTP GETs the gateway URL instead of sessions.list RPC, so a live gateway root may list nothing until that is wired. Hermes local mode still reads sessions.json, not sqlite. Hostname origins do not match lanIp (KTD2). stateDir is not chrooted to home; NUL is rejected. Fetch allowlisting matches existing Spark SSH hosts (no DNS-to-IP rebind check).

No migration. Rollout is Settings attach, then watch the Spark page.

After deploy: [occupancy] poll error: in the server log should self-clear at the 3s fetch timeout. GET /api/session-sources must not include a token field.

Evidence

  • npm test — 100 pass, 0 fail (after review fixes)
  • npx tsc --noEmit was not run to completion here (node_modules/react missing on this host)
  • Review: complete, Ready with fixes, run 20260814-212653-229754b4
  • No live OpenClaw/Hermes attach on this host for this PR; collector tests use fixtures

No screenshots. The list is a small named-row UI on the existing LLM panel.


Compound Engineering

Operators can attach conversation sources from Settings via local
convention, state dir, or URL, with tokens kept in the secrets store.
Match conversation origins to Spark LLM listen host and port, and badge
each row from mid-turn only so recency cannot mint generating.
Map sessions.list rows to projector input using provider baseUrl and
hasActiveRun, returning an empty list when the source is unreachable.
…ating

Map dashboard session rows to projector input from billing/profile origin,
keeping is_active as unknown unless a live status is present.
Poll OpenClaw and Hermes occupancy once per LLM tick and list generating,
stalled, or unknown chats without touching the existing LLM probe.
Pull duplicated URL/path/fetch helpers out of OpenClaw and Hermes readers
and skip no-op occupancy writes when the conversation list is unchanged.
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.

1 participant