Skip to content

fix: stabilize whatsapp runtime reconnect#668

Merged
Siri-Ray merged 3 commits intomainfrom
fix/whatsapp-launchd-reconnect
Mar 30, 2026
Merged

fix: stabilize whatsapp runtime reconnect#668
Siri-Ray merged 3 commits intomainfrom
fix/whatsapp-launchd-reconnect

Conversation

@Siri-Ray
Copy link
Copy Markdown
Contributor

What

Stabilize WhatsApp disconnect/reconnect and multi-account switching in the desktop runtime.

Why

WhatsApp reconnects were not reliably replacing the active runtime listener. After disconnecting one linked account and connecting another, the old provider could remain alive and continue replying. This happened because launchd mode only hot-reloaded config and never actually restarted the OpenClaw service for WhatsApp lifecycle changes.

How

  • restart OpenClaw explicitly for WhatsApp connect/disconnect in launchd mode via the launchd service label
  • persist and reuse OpenClaw WS device auth tokens so controller reconnects do not fail with device-signature errors
  • tighten OpenClaw path/env resolution for desktop launchd startup
  • harden runtime dependency repair checks in openclaw-runtime/postinstall.mjs
  • keep WhatsApp disconnect semantics as unbind-only while ensuring the listener is actually replaced on reconnect

Affected areas

  • Desktop app (Electron shell)
  • Controller (backend / API)
  • Web dashboard (React UI)
  • OpenClaw runtime
  • Skills
  • Shared schemas / packages
  • Build / CI / Tooling

Checklist

  • pnpm typecheck passes
  • pnpm lint passes
  • pnpm test passes
  • pnpm generate-types run (if API routes/schemas changed)
  • No credentials or tokens in code or logs
  • No any types introduced (use unknown with narrowing)

Notes for reviewers

pnpm test currently has one unrelated existing failure in tests/desktop/skill-dir-watcher.test.ts (detects new SKILL.md and syncs ledger after debounce).

Manual verification completed locally:

  • first-time WhatsApp connect succeeds
  • disconnect no longer logs out the linked device
  • reconnect with the same account works
  • reconnect with a different account correctly switches the active runtime listener instead of keeping the old account online

@cloudflare-workers-and-pages
Copy link
Copy Markdown

cloudflare-workers-and-pages Bot commented Mar 30, 2026

Deploying nexu-docs with  Cloudflare Pages  Cloudflare Pages

Latest commit: 456b1f2
Status: ✅  Deploy successful!
Preview URL: https://d7ba9ba3.nexu-docs.pages.dev
Branch Preview URL: https://fix-whatsapp-launchd-reconne.nexu-docs.pages.dev

View logs

Copy link
Copy Markdown

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: bc8c4084c9

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread apps/controller/src/services/channel-service.ts
@Siri-Ray Siri-Ray merged commit 8e12ba1 into main Mar 30, 2026
11 checks passed
@lefarcen lefarcen mentioned this pull request Mar 30, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants