[codex] Add WhatsApp phone-code login#85866
Conversation
|
Codex review: needs maintainer review before merge. Latest ClawSweeper review: 2026-05-24 07:27 UTC / May 24, 2026, 3:27 AM ET. Workflow note: Future ClawSweeper reviews update this same comment in place. How this review workflow works
PR Surface View PR surface stats
Summary Reproducibility: not applicable. as a strict bug reproduction because this PR adds a new phone-code login capability. The PR body does provide structured real-device proof for the new flow, and source review covers the partial-credential cleanup path. PR rating Rank-up moves:
What the crustacean ranks mean
Shiny media proof means a screenshot, video, or linked artifact directly shows the changed behavior. Runtime, network, CSP, and security claims still need visible diagnostics. Real behavior proof Risk before merge
Maintainer options:
Next step before merge Security Review detailsBest possible solution: Land this after maintainers accept the generic auth-hint contract or re-scope it to a WhatsApp-owned login surface while preserving backup-safe partial credential cleanup. Do we have a high-confidence way to reproduce the issue? Not applicable as a strict bug reproduction because this PR adds a new phone-code login capability. The PR body does provide structured real-device proof for the new flow, and source review covers the partial-credential cleanup path. Is this the best way to solve the issue? Unclear pending maintainer decision: the WhatsApp-local implementation follows Baileys' pairing-code contract and the prior backup-loss defect appears fixed, but making Label changes:
Label justifications:
What I checked:
Likely related people:
Codex review notes: model gpt-5.5, reasoning high; reviewed against c14a0c6d63f7. |
1d69ab0 to
1ffc9a0
Compare
|
ClawSweeper PR egg ✨ Hatched: 🥚 common Clockwork Branchling Hatch commandComment Hatchability rules:
Rarity: 🥚 common. What is this egg doing here?
|
0546421 to
20670fe
Compare
20670fe to
518b110
Compare
Summary
openclaw channels login --phone-number <number>to the generic channel auth adapter and CLIWhy
QR-based WhatsApp linking can be awkward or impossible in headless setups, and it can fail when the phone scanner does not pick up the terminal/dashboard QR. The phone-number pairing flow creates the same saved WhatsApp Web credentials after a one-time code entry on the phone, so the CLI can continue normally afterward.
Closes #85867.
Refs #15614, #85868.
Real behavior proof
Behavior addressed: WhatsApp linking when QR scanning is unavailable or unreliable from a headless gateway host.
Real environment tested: local OpenClaw source checkout running against a physical Android WhatsApp device and a named WhatsApp account, with private identifiers redacted.
Exact steps or command run after this patch: ran
openclaw channels login --channel whatsapp --account <account> --phone-number <country-code-and-number>, entered the printed pairing code on the phone under WhatsApp > Linked Devices > Link with phone number using an ADB-controlled phone UI, restarted the gateway during the nativeLogging in.../ 515 phase, then ranopenclaw channels status --channel whatsapp --account <account> --probe.Evidence after fix: OpenClaw printed a pairing code, the phone accepted it in the linked-device code flow, OpenClaw then logged
WhatsApp asked for a restart after pairing (code 515); waiting for creds to save…,WhatsApp Web connected., andLinked after restart; web session ready.Observed result after fix: final channel status was linked, healthy, running, and connected with no last error; the phone's Linked Devices screen showed an active web session.
What was not tested: a completely unattended flow with no reachable phone UI was not tested. The gateway/operator side can be headless when the phone UI is remotely controllable, such as Android over ADB or an iPhone via a simulator/remote-control path; this PR does not change broader 515 restart recovery behavior beyond documenting the observed sequence.
Verification
pnpm test extensions/whatsapp/src/login.test.ts extensions/whatsapp/src/login.coverage.test.ts extensions/whatsapp/src/login-qr.test.ts extensions/whatsapp/src/auth-store.test.ts extensions/whatsapp/src/accounts.whatsapp-auth.test.ts src/cli/channel-auth.test.tspnpm check:changedpnpm build