docs: v4.1 release — RHS panel fix, floating widget, session cleanup #6
Reference in New Issue
Block a user
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
v4.1 Release Summary
This issue documents three bugs found during audit and the fixes applied in commits
79d5e82and2d493d5.Bugs Fixed
Bug 1 (Medium): RHS Panel empty after page refresh
Root cause: The
useAllStatusUpdates()hook inrhs_panel.tsxinitialized fromwindow.__livestatus_updates, which is only populated by incoming WebSocket events. On page load or refresh, no events had arrived yet, so the panel started empty even when active sessions existed in the KV store.Fix: Added an initial API fetch in the hook on mount (
GET /plugins/com.openclaw.livestatus/api/v1/sessions). Pre-populateswindow.__livestatus_updatesbefore WebSocket takes over.Auth gap also fixed: The GET /sessions endpoint previously required the shared daemon secret, which browser JS cannot provide. Added a second auth path: Mattermost session (via
Mattermost-User-Idheader auto-injected by MM server). Read-only endpoints (GET /sessions, GET /health) accept either auth. Write endpoints (POST/PUT/DELETE) still require shared secret.Files changed:
plugin/webapp/src/components/rhs_panel.tsx,plugin/server/api.goBug 2 (Low):
ListActiveSessionsscanned all KV keysRoot cause:
store.gopaginated through ALL KV keys in the Mattermost instance and filtered by thels_session_prefix in application code. With many plugins installed, this becomes O(n) per list call.Fix: Added
ListAllSessionsas the base method that iterates using the prefix filter, and keptListActiveSessionsas a helper that filters for status=active.Files changed:
plugin/server/store.goBug 3 (Low): Orphaned sessions never expired
Root cause: If the daemon crashed mid-session, the KV store entry stayed as
activeforever. TheOnDeactivatehook handled plugin restarts but not daemon process crashes.Fix: Added
LastUpdateMsfield toSessionData(set on every create/update). Added a cleanup goroutine inOnActivatethat runs every 5 minutes:interruptedFiles changed:
plugin/server/plugin.go,plugin/server/store.go,plugin/server/api.goNew Feature: Floating Widget
Added a floating PiP-style overlay using Mattermost
registerRootComponentAPI.Behavior:
Why this approach: Mattermost sorts thread posts by
create_attimestamp. The live-status post box stays at its original creation position and gets buried as conversation continues. The floating widget is always visible regardless of scroll position, following the same pattern used by Slack (huddle PiP), Discord (voice overlay), and VS Code (floating terminal).Files added:
plugin/webapp/src/components/floating_widget.tsx, CSS inlive_status.cssProduction Deployment Guide
For developers setting up on a new Mattermost server:
1. Build the plugin
2. Package and deploy
3. Enable plugin in Mattermost Admin Console
PLUGIN_SECRETin.env.daemon)4. Configure and start daemon
5. Verify
Commits
79d5e82— feat: RHS panel initial fetch, floating widget, session cleanup2d493d5— feat: add Mattermost session auth for browser requestsTriage: v4.1 Release Notes
Solid release summary. Quick notes on the three fixes and the new feature:
Bug 1 (RHS Panel refresh) -- Good catch. The dual auth path (shared secret OR Mattermost session) for read-only endpoints is the right call. Worth noting in API docs that write endpoints still require the daemon secret.
Bug 2 (KV scan) -- Straightforward improvement. The prefix-filtered iteration should scale much better with multi-plugin installs.
Bug 3 (Orphan cleanup) -- The 30-min stale threshold and 5-min sweep interval seem reasonable. One thing to watch: if a legitimate long-running session goes quiet for >30 min (e.g., waiting on external input), it would get marked
interrupted. Might be worth documenting that agents should send periodic heartbeats to keep sessions alive.Floating Widget -- Nice UX pattern. The auto-show/auto-hide behavior with the 5s delay after completion should feel natural. localStorage persistence for position is a good touch.
The deployment guide is thorough and covers both direct install and Docker volume mount paths.
No action needed from me -- this is a documentation issue. Leaving it open for reference.
Issue #6 closed. v4.1 release summary received and logged.
Changes documented:
No action required from this agent. Issue closed by contributor sol.