feat(whatsapp): support Baileys WebSocket URL override#97155
Conversation
|
Codex review: needs maintainer review before merge. Reviewed June 29, 2026, 1:25 PM ET / 17:25 UTC. Summary PR surface: Source +13, Tests +39. Total +52 across 3 files. Reproducibility: not applicable. this is a feature/config-surface PR rather than a reported current-main bug. Source inspection confirms current main lacks the override, while the PR head forwards explicit and env-derived URLs to Baileys with focused tests. Review metrics: 1 noteworthy metric.
Stored data model Root-cause cluster Members:
Proposal only: this assessment does not dispatch repair, suppress jobs, mutate sibling items, close, or merge anything. Merge readiness Overall follows the weaker of proof and patch quality, so missing proof can cap an otherwise strong patch. Rank-up moves:
Risk before merge
Maintainer options:
Next step before merge
Security Review detailsBest possible solution: Use this narrow Baileys Do we have a high-confidence way to reproduce the issue? Not applicable; this is a feature/config-surface PR rather than a reported current-main bug. Source inspection confirms current main lacks the override, while the PR head forwards explicit and env-derived URLs to Baileys with focused tests. Is this the best way to solve the issue? Yes, conditionally; using Baileys' native AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning high; reviewed against 6de357ad4772. Label changesLabel changes:
Label justifications:
Evidence reviewedPR surface: Source +13, Tests +39. Total +52 across 3 files. View PR surface stats
What I checked:
Likely related people:
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. How this review workflow works
|
7430b67 to
258b831
Compare
0f2992c to
7714a80
Compare
|
@clawsweeper re-review |
|
🦞🧹 I asked ClawSweeper to review this item again. |
4c137ce to
e50621d
Compare
|
@clawsweeper re-review |
|
🦞🧹 I asked ClawSweeper to review this item again. |
e50621d to
8670e13
Compare
|
@clawsweeper re-review |
|
🦞🧹 I asked ClawSweeper to review this item again. |
|
@clawsweeper re-review |
|
🦞🧹 I asked ClawSweeper to review this item again. |
|
@clawsweeper re-review |
|
🦞🧹 I asked ClawSweeper to review this item again. |
* Allow WhatsApp monitor socket substitution * Refine WhatsApp socket substitution surface * Keep WhatsApp socket seam on existing API * Tighten WhatsApp socket seam type exports * Simplify WhatsApp monitor runtime option state * Use WhatsApp WebSocket URL override
* Allow WhatsApp monitor socket substitution * Refine WhatsApp socket substitution surface * Keep WhatsApp socket seam on existing API * Tighten WhatsApp socket seam type exports * Simplify WhatsApp monitor runtime option state * Use WhatsApp WebSocket URL override
* Allow WhatsApp monitor socket substitution * Refine WhatsApp socket substitution surface * Keep WhatsApp socket seam on existing API * Tighten WhatsApp socket seam type exports * Simplify WhatsApp monitor runtime option state * Use WhatsApp WebSocket URL override
* Allow WhatsApp monitor socket substitution * Refine WhatsApp socket substitution surface * Keep WhatsApp socket seam on existing API * Tighten WhatsApp socket seam type exports * Simplify WhatsApp monitor runtime option state * Use WhatsApp WebSocket URL override
What Problem This Solves
PR #95920 needs WhatsApp to point its normal Baileys socket at a local provider-compatible WebSocket endpoint without adding QA-specific socket factories, globals, or Crabline-aware branches to the WhatsApp plugin.
What Changed
OPENCLAW_WHATSAPP_WEB_SOCKET_URLas an environment override for the BaileyswaWebSocketUrloption insidecreateWaSocket.waWebSocketUrloption tocreateWaSocketfor direct low-level callers, with explicit options taking precedence over environment..envblocking.User Impact
Default WhatsApp behavior is unchanged. Without
OPENCLAW_WHATSAPP_WEB_SOCKET_URL, OpenClaw still lets Baileys use its normal WhatsApp Web endpoint. QA or owner-controlled runtime env can point Baileys at a compatible local WebSocket endpoint.Workspace
.envremains untrusted for this control becauseOPENCLAW_WHATSAPP_WEB_SOCKET_URLis covered by the existingOPENCLAW_*workspace blocklist.Evidence
pnpm exec oxfmt --check extensions/whatsapp/src/session.ts extensions/whatsapp/src/session.test.ts src/infra/dotenv.test.tsnode scripts/run-vitest.mjs run --config test/vitest/vitest.extension-whatsapp.config.ts whatsapp/src/session.test.ts whatsapp/src/connection-controller.test.tsnode scripts/run-vitest.mjs run --config test/vitest/vitest.infra.config.ts src/infra/dotenv.test.tspnpm tsgo:extensions:test