Skip to content

Conversation

@roomote
Copy link
Contributor

@roomote roomote bot commented Jan 15, 2026

This PR attempts to address Issue #10737 by implementing a webview heartbeat monitoring system.

Problem

Users report that the Roo Code panel occasionally turns completely gray during long-running tasks with auto-approval enabled ("brrrr mode"). The panel becomes unresponsive while the extension continues working in the background.

Solution

Implements a ping-pong heartbeat system to detect when the webview becomes unresponsive and provide auto-recovery options:

  • Heartbeat monitoring: Extension sends "ping" messages to webview every 5 seconds
  • Webview response: Webview immediately responds with "pong" messages
  • Unresponsive detection: After 3 missed heartbeats (15 seconds), webview is considered unresponsive
  • Auto-recovery: Shows notification with "Reload Panel" option to recover

Changes

  • Add ping/pong message types to ExtensionMessage and WebviewMessage
  • Implement heartbeat sender and monitoring in ClineProvider
  • Add automatic detection of unresponsive webviews after 3 missed heartbeats
  • Show notification with option to reload webview on detection
  • Handle pong messages in webviewMessageHandler
  • Respond to ping messages in webview ExtensionStateContext

Testing

  • All existing ClineProvider tests pass
  • All ExtensionStateContext tests pass
  • TypeScript compilation passes for both src and webview-ui

Feedback and guidance are welcome.


Important

Adds heartbeat monitoring to detect and recover from unresponsive webviews by sending periodic "ping" messages and expecting "pong" responses.

  • Behavior:
    • Implements heartbeat monitoring in ClineProvider to detect unresponsive webviews by sending "ping" messages every 5 seconds and expecting "pong" responses.
    • After 3 missed "pong" responses (15 seconds), considers the webview unresponsive and shows a notification with a "Reload Panel" option.
  • Message Handling:
    • Adds "ping" and "pong" message types to ExtensionMessage and WebviewMessage.
    • Handles "pong" messages in webviewMessageHandler to reset the heartbeat timer.
    • Responds to "ping" messages in ExtensionStateContextProvider by sending "pong" back.
  • Integration:
    • Starts heartbeat monitoring in ClineProvider when a new session begins.
    • Stops monitoring when the provider is disposed.
    • Updates webviewMessageHandler to handle "pong" messages and reset the heartbeat timer.

This description was created by Ellipsis for 122d28f. You can customize this summary. It will automatically update as commits are pushed.

…recovery

Implements a ping-pong heartbeat system to detect when the webview becomes
unresponsive (gray screen issue) and provide auto-recovery options.

Changes:
- Add ping/pong message types to ExtensionMessage and WebviewMessage
- Implement heartbeat sender and monitoring in ClineProvider
- Add automatic detection of unresponsive webviews after 3 missed heartbeats
- Show notification with option to reload webview on detection
- Handle pong messages in webviewMessageHandler
- Respond to ping messages in webview ExtensionStateContext

Fixes #10737
@roomote
Copy link
Contributor Author

roomote bot commented Jan 15, 2026

Rooviewer Clock   See task on Roo Cloud

Code review complete. No issues identified.

The heartbeat monitoring implementation is well-structured:

  • Type definitions for ping/pong messages are properly added
  • Heartbeat interval and timeout logic is correctly implemented
  • Edge cases are handled appropriately (hidden view, dispose cleanup)
  • Recovery mechanism properly regenerates webview HTML and restarts monitoring

Mention @roomote in a comment to request specific changes to this pull request or fix all unresolved issues.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: Triage

Development

Successfully merging this pull request may close these issues.

2 participants