openclaw - 💡(How to fix) Fix [Bug]: Android node sends node.event before websocket connect handshake completes, causing notification events to be lost [1 pull requests]

Official PRs (…)
ON THIS PAGE

Recommended Tools

×6

Utilities matched from this issue’s tags and category — try them while you read without losing context.

GitHub issue graph ai analysis

Paste a GitHub issue URL. We fetch that issue, discover linked issues from bodies/comments/timeline, collect linked pull requests, and produce a structured English report.

The report is written in English Markdown for sharing and archival.

Helpful · Quick feedback

Loading…

When the Android node (OpenClaw app v2026.5.7 on Pixel 10) sends notification events via node.event during reconnect, the gateway rejects them with "invalid handshake: first request must be connect" because node.event is sent before the websocket connect handshake completes. Android does not retry the failed event, so the notification is lost and notification-based automations never wake the agent.

Root cause:

  • apps/android/app/src/main/java/ai/openclaw/app/gateway/GatewaySession.kt sets GatewaySession.currentConnection before conn.connect() completes.
    • apps/android/app/src/main/java/ai/openclaw/app/NodeRuntime.kt does not queue or retry failed sendNodeEvent calls.
      • apps/android/app/src/main/java/ai/openclaw/app/node/DeviceNotificationListenerService.kt does not reconcile/replay missed posted notifications after reconnect. Gateway log evidence:
{
  "lastFrameMethod": "node.event",
  "handshakeError": "invalid handshake: first request must be connect",
  "client": "openclaw-android",
  "clientDisplayName": "Pixel 10"
}

Impact: Android notifications such as BBVA notifications never trigger system events, so all notification-based automations fail.

Root Cause

When the Android node (OpenClaw app v2026.5.7 on Pixel 10) sends notification events via node.event during reconnect, the gateway rejects them with "invalid handshake: first request must be connect" because node.event is sent before the websocket connect handshake completes. Android does not retry the failed event, so the notification is lost and notification-based automations never wake the agent.

Fix Action

Fixed

Code Example

{
  "lastFrameMethod": "node.event",
  "handshakeError": "invalid handshake: first request must be connect",
  "client": "openclaw-android",
  "clientDisplayName": "Pixel 10"
}

---

{
  "lastFrameMethod": "node.event",
  "handshakeError": "invalid handshake: first request must be connect",
  "client": "openclaw-android",
  "clientDisplayName": "Pixel 10"
}

---
RAW_BUFFERClick to expand / collapse

Bug type

Behavior bug (incorrect output/state without crash)

Beta release blocker

No

Summary

When the Android node (OpenClaw app v2026.5.7 on Pixel 10) sends notification events via node.event during reconnect, the gateway rejects them with "invalid handshake: first request must be connect" because node.event is sent before the websocket connect handshake completes. Android does not retry the failed event, so the notification is lost and notification-based automations never wake the agent.

Root cause:

  • apps/android/app/src/main/java/ai/openclaw/app/gateway/GatewaySession.kt sets GatewaySession.currentConnection before conn.connect() completes.
    • apps/android/app/src/main/java/ai/openclaw/app/NodeRuntime.kt does not queue or retry failed sendNodeEvent calls.
      • apps/android/app/src/main/java/ai/openclaw/app/node/DeviceNotificationListenerService.kt does not reconcile/replay missed posted notifications after reconnect. Gateway log evidence:
{
  "lastFrameMethod": "node.event",
  "handshakeError": "invalid handshake: first request must be connect",
  "client": "openclaw-android",
  "clientDisplayName": "Pixel 10"
}

Impact: Android notifications such as BBVA notifications never trigger system events, so all notification-based automations fail.

Steps to reproduce

  1. Run OpenClaw gateway v2026.5.7.
    1. Pair/connect an Android node running OpenClaw app v2026.5.7 on a Pixel 10.
    1. Ensure Android notification forwarding is enabled.
    1. Force the Android node into a reconnect window (for example, restart the gateway, briefly interrupt network connectivity, or otherwise cause websocket reconnect).
    1. While the reconnect is in progress, receive an Android notification (for example, a BBVA notification).
    1. Inspect gateway logs and agent/system events. Observed log evidence includes:
{
  "lastFrameMethod": "node.event",
  "handshakeError": "invalid handshake: first request must be connect",
  "client": "openclaw-android",
  "clientDisplayName": "Pixel 10"
}

Expected behavior

The Android node should not send node.event frames until the websocket connect handshake has completed successfully. Notification events that arrive during reconnect should be queued/retried, flushed after reconnect, and missed posted notifications should be reconciled so the agent receives the system event and notification-based automations run.

Actual behavior

repo:openclaw/openclaw deEvent() sees GatewaySession.currentConnection != null and sends node.event as the first websocket frame before conn.connect() has completed. The gateway rejects the frame with "invalid handshake: first request must be connect". Android does not retry or replay the failed notification event, so the notification is permanently lost and the agent is not woken.

OpenClaw version

2026.5.7

Operating system

Ubuntu 24

Install method

npm

Model

minimax 2.7

Provider / routing chain

openclaw

Additional provider/model setup details

Android app v2026.5.7; gateway v2026.5.7key--clearmodifiersTabtype--delay5--clearmodifiersAndroid on Pixel 10; gateway v2026.5.7key--clearmodifiersTabtype--delay5--clearmodifiersAndroid app paired node with OpenClaw gatewaykey--clearmodifiersTabtype--delay5--clearmodifiersN/A - Android notification node.event pathkey--clearmodifiersTabtype--delay5--clearmodifiersAndroid node -> websocket gateway -> system event / notification automation

Logs, screenshots, and evidence

Impact and severity

No response

Additional information

No response

Vote matrix · Quick signals

Works
Did the solution work? Tap to confirm.
Easy Fix
Was it a quick fix?
Time Saver
Did it save you time?
Blocking
Was it severely blocking?
Common Issue
Are others likely hitting this too?
Flaky / Intermittent
Is it intermittent?
Verified / Reproducible
Can you reproduce it reliably?
Loading…

FAQ

Expected behavior

The Android node should not send node.event frames until the websocket connect handshake has completed successfully. Notification events that arrive during reconnect should be queued/retried, flushed after reconnect, and missed posted notifications should be reconciled so the agent receives the system event and notification-based automations run.

Still need to ship something?

×6

Another batch ranked right after the header list — different links, same matching logic.

Back to top recommendations

TRENDING

openclaw - 💡(How to fix) Fix [Bug]: Android node sends node.event before websocket connect handshake completes, causing notification events to be lost [1 pull requests]