-
Notifications
You must be signed in to change notification settings - Fork 43
feat(v0.11): Stuck Session Alerts — detect and surface session.stuck events in real time #29
Description
Problem
From the same real-world deployment:
"There were stretches where I had no idea if it was making progress, stuck in a loop, or waiting on a hanging install process."
OpenClaw emits session.stuck diagnostic events when a session exceeds expected duration. ClawMetry receives these via the log stream but does nothing with them.
What's Already There
/api/logs-streamSSE tails the log file (issue feat(v0.11): Live Log Tail Tab — real-time /tmp/openclaw/*.log viewer with filtering #27)- OTLP receiver already handles
openclaw.session.stuckmetric startLogStream()already processes every log line in JS
What's Missing
When a session.stuck event appears in the log stream:
- Top banner — persistent alert with session key, stuck duration, link to transcript. Appears on every tab. Dismissable.
- Sessions tab badge — count of currently stuck sessions
- Red highlight on stuck session rows
Alert clears automatically when a terminal session.state event arrives for that session.
Where to Change
1. Add banner HTML — one <div id="stuck-banner"> just after the nav bar closes, before the first <div class="page"> block.
2. In startLogStream() JS (line 5202, logStream.onmessage) — add a check: if the parsed line contains session.stuck, call showStuckAlert(sessionId, ageMs).
3. Add showStuckAlert() function — updates the banner, increments a badge on the Sessions nav tab.
4. Clear on terminal state — same onmessage handler: if line contains session.state with a terminal value, call clearStuckAlert(sessionId).