-
-
Notifications
You must be signed in to change notification settings - Fork 52.5k
Closed
Description
Environment
- OpenClaw Version: 2026.2.17
- OS: macOS 15.3 (Tahoe)
- Browser: Chrome 145.0.7632.77
- Gateway: Running as LaunchAgent on 127.0.0.1:18789
Issue Summary
The dashboard's /chat page becomes unresponsive (Chrome shows "Page Unresponsive") when the session history contains many messages. This creates a poor user experience and makes the dashboard unusable for power users with extended conversations.
Symptoms
- Chat page hangs: The /chat page frequently causes Chrome to show "Page Unresponsive" dialog
- No streaming: Chat shows thinking indicator (...) but never streams the response in real-time
- WebSocket disconnects: Gateway logs show repeated WebSocket connect/disconnect cycles (code=1001)
- Other pages work fine: Overview and other dashboard pages load normally
Root Cause Analysis
After investigation, we found:
- Current session had 292 messages totaling 1.5MB
- Some archived sessions were up to 8.2MB
- The chat UI appears to load and render the entire message history at once
- This causes Chrome to hang when rendering large histories
Gateway Logs (WebSocket disconnects)
[ws] webchat disconnected code=1001 reason=n/a
[ws] webchat connected conn=...
[ws] webchat disconnected code=1001 reason=n/a (2-4 seconds later)
[ws] webchat connected conn=...
The rapid connect/disconnect cycle (code=1001 = client-initiated "Going Away") suggests the browser is killing the tab due to unresponsiveness, then the UI tries to reconnect.
Workaround
Archiving large session files (>1MB) to a separate directory fixes the issue:
mkdir -p ~/.openclaw/agents/main/sessions/archive
mv ~/.openclaw/agents/main/sessions/<large-session>.jsonl ~/.openclaw/agents/main/sessions/archive/
openclaw gateway restartSuggested Fixes
- Virtualized list rendering: Use virtual scrolling (e.g., react-window, @tanstack/virtual) to only render visible messages
- Pagination: Load messages in chunks (e.g., last 50 messages, load more on scroll up)
- Lazy loading: Don't fetch full message content until user scrolls to it
- Message truncation: Collapse large tool outputs by default, expand on click
- Session size warning: Alert users when session is getting large, suggest archiving
Additional Context
- Also encountered Issue 1 (resolved): CSS contained Google Fonts @import that was blocked by gateway's CSP (
font-src 'self'), causing blank page. Fixed by manually stripping the import.
Reproduction Steps
- Use OpenClaw extensively via iMessage/Telegram (accumulate 200+ messages)
- Open dashboard at http://127.0.0.1:18789/
- Navigate to /chat
- Observe page becoming unresponsive
Labels
bug, dashboard, performance
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels