skip to content

Your OpenClaw WhatsApp account went silent after someone removed it from the phone's Linked devices; what happened and how do you recover?

level: seniorimportance: should knowfreq 6%

answer

  1. the phone revoked the device
  2. logged out is not a reconnect
  3. status says Session logged out
  4. relink with channels login
  5. stop and start keep credentials

basics

~20 s

Removing the linked device logs the WhatsApp Web session out; the Gateway stops that account rather than retrying, and status reports the session logged out. Recovery is rerunning openclaw channels login for that account and scanning a new QR.

solid answer

~40 s

OpenClaw is a **linked device** of the WhatsApp account, so removing it under Linked devices revokes the session. WhatsApp closes the socket with a logged-out status, and the Gateway's WhatsApp monitor **stops** that account instead of entering its reconnect loop; `openclaw channels status` shows "Session logged out" and suggests relinking, and outbound sends fail fast because no listener is active. Recover with `openclaw channels login --channel whatsapp --account <id>` in a terminal on the Gateway host and scan a fresh QR; if WhatsApp still rejects the old session during login, the login flow clears it and shows a new code. A Gateway restart or the `channels.stop`/`channels.start` RPCs will not help, because they restart a listener with credentials WhatsApp has already revoked.

go deeper

for a junior

Recall that OpenClaw is a linked device of the WhatsApp account, and that relinking means running openclaw channels login and scanning a new QR.

for a middle

Explain why logged out differs from a disconnect: the monitor stops instead of reconnecting, status reports Session logged out, and sends fail fast.

for a senior

Pick the right recovery under pressure: relink for revoked credentials, stop and start for a wedged listener, and logout plus login after a backup for a persistent loop.

for a principal

Treat device-linked channels as an availability risk owned by whoever holds the phone, and decide on dedicated numbers and probe-based alerting accordingly.

## The failure: a revoked linked device OpenClaw connects to WhatsApp through **WhatsApp Web** as a **linked device**. The phone stays the account's primary device, and anyone holding it can open **WhatsApp > Linked devices** and remove OpenClaw. When that happens, WhatsApp closes the connection with its **logged-out** status. Nothing on the OpenClaw host changed, yet the stored session in `~/.openclaw/credentials/whatsapp/<accountId>/` no longer works. ## How the Gateway reacts The WhatsApp monitor treats close reasons differently: - **Ordinary disconnects** (network loss, transport silence) go through the reconnect loop. A watchdog restarts only when transport frames stop for a fixed window or application messages stay silent past a longer safety window, so a quiet account is not churned. - **Logged out** is terminal for that session. The monitor records the `logged-out` health state, logs that the session was logged out with the relink command, and **stops** the account instead of retrying. - **Session conflict** statuses also stop the monitor, with advice to resolve the conflicting WhatsApp Web sessions. Consequences an operator sees: 1. `openclaw channels status` reports the account as not linked, with the issue "Session logged out" and the fix: run `openclaw channels login` and scan the QR on the Gateway host. 2. Outbound sends to that account fail fast, because sending requires an active listener. 3. Other channels and other WhatsApp accounts keep running; the failure is per account. ## Why logged out is not retried Retrying makes sense when the network or WhatsApp's servers had a bad moment: the stored credentials are still good, and a reconnect will succeed. A logged-out close means the opposite. The phone (or WhatsApp itself) has invalidated the device keys, so every retry with the same files would fail the same way, and a tight retry loop would only add noise and load. Stopping the account and saying so turns a silent failure into a clear operator task. It also keeps the decision with a human: relinking needs the phone in hand, and only the operator can judge whether the device was removed on purpose. ## Recovery ```bash openclaw channels status --channel whatsapp --probe openclaw channels login --channel whatsapp --account <accountId> openclaw channels status --channel whatsapp --probe ``` The login flow handles the stale session: if WhatsApp still answers the old credentials with logged out, login clears the cached web session and restarts once with a fresh QR. After a successful login the CLI asks a reachable local Gateway to start the account, so no full restart is needed. ## Tools that look right but are not | Command | What it does | Helps here? | |---|---|---| | `openclaw gateway call channels.stop` / `channels.start` (needs `operator.admin`) | Restarts one account's listener and keeps its credentials | No: the credentials are revoked | | `openclaw gateway restart` | Restarts the whole Gateway | No: the same revoked session is reused | | `openclaw channels logout --channel whatsapp --account <id>` | Stops the listener and clears that account's auth state | Optional before login; login is still required | | `openclaw pairing approve whatsapp <CODE>` | Admits a DM sender | No: unrelated to the device link | The non-destructive stop and start are for a different failure: a linked account stuck in a reconnect loop whose credentials are still valid. For a loop that persists after fixing connectivity, the docs suggest backing up the account's auth directory, then `channels logout` and `channels login`. ## Preventing a repeat - Use a **dedicated number** for the assistant, so nobody tidies up "unknown" linked devices on their personal phone. - Watch for it: a scheduled `openclaw channels status --probe` surfaces a logged-out account long before someone notices silence. - On a headless host, keep a reliable way to deliver a live QR to the phone, because every relink needs one. - Back up `~/.openclaw/credentials/whatsapp/<accountId>` before deliberate relinks; the folder is the device's identity.

  • When would you use the channels.stop and channels.start RPCs instead of logging in again?
    When the account is still validly linked but its listener is wedged, for example a reconnect loop after a network change. `openclaw gateway call channels.stop` and `channels.start` with the same `accountId` restart that one account and keep its pairing and credentials; both require `operator.admin`. They cannot fix a revoked device.
  • How would you notice a logged-out WhatsApp account before users complain?
    Run `openclaw channels status --probe` on a schedule; a logged-out account reports "Session logged out" with the relink fix, and outbound sends fail fast, which shows up in Gateway logs.

  • The Gateway keeps retrying a logged-out WhatsApp session until it reconnects by itself.
  • Restarting the Gateway re-establishes a WhatsApp session the phone removed.
  • channels.stop and channels.start relink an account whose device was revoked.
  • A logged-out WhatsApp account takes every other channel down with it.
  • Approving a pairing code reconnects the linked device.