fix(whatsapp): route captured replies through successor controller after restart#85823
Conversation
|
Codex review: needs real behavior proof before merge. Reviewed June 8, 2026, 10:55 PM ET / 02:55 UTC. Summary PR surface: Source +283, Tests +2. Total +285 across 5 files. Reproducibility: Do we have a high-confidence way to reproduce the issue? Source inspection and the PR's production before-logs make the failure path credible, but I did not reproduce it in a live WhatsApp setup; current main shows the captured reply closure remains tied to the old socketRef. Review metrics: 2 noteworthy metrics.
Merge readiness Overall follows the weaker of proof and patch quality, so missing proof can cap an otherwise strong patch. Rank-up moves:
Proof guidance:
Mantis proof suggestion Risk before merge
Maintainer options:
Next step before merge
Security Review detailsBest possible solution: Land the focused fallback after live or maintainer-owned WhatsApp restart proof shows same-identity reply/media delivery through the successor controller and keeps the mismatch guard covered. Do we have a high-confidence way to reproduce the issue? Do we have a high-confidence way to reproduce the issue? Source inspection and the PR's production before-logs make the failure path credible, but I did not reproduce it in a live WhatsApp setup; current main shows the captured reply closure remains tied to the old socketRef. Is this the best way to solve the issue? Is this the best way to solve the issue? Yes pending proof: the PR keeps the repair inside the WhatsApp plugin's existing controller registry and centralizes the handoff for all current socket consumers, with same-identity guards rather than a broad fallback. AGENTS.md: found and applied where relevant. Codex review notes: model gpt-5.5, reasoning high; reviewed against 9f48254f099a. Label changesLabel changes:
Label justifications:
Evidence reviewedPR surface: Source +283, Tests +2. Total +285 across 5 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
|
|
ClawSweeper PR egg 🎁 Pass real behavior proof to wake the egg and unlock a hatchable treat. Where did the egg go?
|
|
Force-pushed v2 (commit @clawsweeper re-review |
|
🦞🧹 I asked ClawSweeper to review this item again. Re-review progress:
|
|
v3 (commit
New regression test "accepts successor-controller fallback when only the LID-vs-PN form differs for the same account e164" covers the case. All 3 successor tests pass; 64/64 in the full behavior suite. On real-behavior proof: I don't have a paired WhatsApp account on this machine. The Vitest tests exercise the actual production code path ( @clawsweeper re-review |
|
🦞🧹 I asked ClawSweeper to review this item again. Re-review progress:
|
aed79fa to
db97b76
Compare
db97b76 to
260ba6b
Compare
…ter restart When a channel-health-monitor restart cycle shuts down a WhatsApp ConnectionController mid-run (closeCurrentConnection nulls the controller's socketRef, stopDisconnectRetries aborts its retry signal, and shutdown unregisters it from the connection-controller registry), any in-flight inbound's captured reply closure is left bound to the now-stale socketRef. sendTrackedMessage's retry loop relies on the same controller's socketRef being repopulated by a reconnect, but the successor controller constructs its own fresh socketRef object, so the captured reply throws RECONNECT_IN_PROGRESS_ERROR indefinitely. Visible symptom: the agent silently fails to reply to a WhatsApp message after a transient 408 disconnect that triggered a health-monitor restart. Extend WhatsAppConnectionControllerHandle with getCurrentSock() and let attachWebInboxToSocket's getCurrentSock helper fall back to a successor controller's socket via the existing connection-controller registry. The fallback fires only when the local socketRef is null, so the steady-state path is unchanged. All current getCurrentSock callers (sendTrackedMessage, groupMetadata, readMessages) benefit. The fallback only swaps the socket object, not the listener's auth state. For the typical health-monitor restart (same accountId, same authDir, fresh socket), this is correct. For a hypothetical relink scenario where the same accountId is re-paired to a different authDir between restarts, JID resolution would still use the listener's original authDir; happy to add an authDir-match guard on the handle if maintainers want it. Test added at monitor-inbox.streams-inbound-messages.test-support.ts exercises the full lifecycle: controller A handles inbound, A shuts down (socketRef null + retries aborted + unregistered), B registers with its own live socket, captured A.reply routes through B's socket. AI-assisted: Claude Code (Opus 4.7) authored, codex review locally addressed.
…ter restart
Address review feedback: gate the successor-socket fallback by the
session's self-identity so an accountId relinked to a different
WhatsApp number cannot be silently accepted.
* WhatsAppConnectionControllerHandle exposes getSelfIdentity() returning
{ jid, lid } from the currently-authenticated socket.
* attachWebInboxToSocket captures the original socket's self identity
at attach time and only accepts the successor when
identitiesOverlap() returns true. The fallback returns null (caller
fails closed) when the successor is unauthenticated, missing, or
logged in as a different number.
* New regression test covers the mismatch path: the successor's
sendMessage is never called when the registered controller's
self identity does not overlap the original.
Known edge case left for maintainer judgment: identitiesOverlap()
compares jid + lid + e164 directly. If the original socket exposes
only one form (PN JID) and the successor exposes only the other
(LID), the overlap can be false-negative because the auth-dir-backed
PN<->LID reverse mapping is not consulted here. Happy to wire
resolveComparableIdentity(authDir) in if maintainers prefer
belt-and-suspenders.
AI-assisted: Claude Code (Opus 4.7) authored, codex review locally
addressed.
Address review feedback on the session-identity guard.
identitiesOverlap() compares { jid, lid, e164 } directly, so a
same-account restart where the original socket exposes only the PN
JID form and the successor exposes only the LID form would
false-negative without an e164 bridge.
Pre-resolve both sides via resolveComparableIdentity(identity,
authDir) so e164 derives from the auth-state PN<->LID mapping.
identitiesOverlap then matches on the normalized form regardless of
which surface form sock.user happens to expose at each end.
* Controller.getSelfIdentity() pre-resolves via this.authDir.
* attachWebInboxToSocket pre-resolves originalSelfIdentity via
options.authDir.
* New regression test: successor exposes only LID + shared e164,
original exposes only PN with e164 derived from JID; overlap
succeeds and the captured reply routes through the successor.
AI-assisted: Claude Code (Opus 4.7) authored, codex review locally
addressed.
260ba6b to
5df8c79
Compare
|
Merged via squash.
Thanks @itsuzef! |
…ter restart (#85823) Merged via squash. Prepared head SHA: 5df8c79 Co-authored-by: itsuzef <[email protected]> Co-authored-by: mcaxtr <[email protected]> Reviewed-by: @mcaxtr (cherry picked from commit 9210d8f)
…ter restart (openclaw#85823) Merged via squash. Prepared head SHA: 5df8c79 Co-authored-by: itsuzef <[email protected]> Co-authored-by: mcaxtr <[email protected]> Reviewed-by: @mcaxtr
…26.6.6) (#1040) This PR contains the following updates: | Package | Update | Change | |---|---|---| | [ghcr.io/openclaw/openclaw](https://openclaw.ai) ([source](https://github.com/openclaw/openclaw)) | patch | `2026.6.5` → `2026.6.6` | --- ### Release Notes <details> <summary>openclaw/openclaw (ghcr.io/openclaw/openclaw)</summary> ### [`v2026.6.6`](https://github.com/openclaw/openclaw/blob/HEAD/CHANGELOG.md#202666) [Compare Source](openclaw/openclaw@v2026.6.5...v2026.6.6) ##### Highlights - Security boundaries are substantially tighter across transcripts, sandbox binds, host environment inheritance, MCP stdio, Codex HTTP access, native search policy, elevated sender checks, deleted-agent ACP bypasses, loopback tools, Discord moderation, and Teams group actions; exec approvals now fail closed on timeout. ([#​91529](openclaw/openclaw#91529), [#​91618](openclaw/openclaw#91618), [#​91615](openclaw/openclaw#91615), [#​91619](openclaw/openclaw#91619), [#​91741](openclaw/openclaw#91741), [#​91745](openclaw/openclaw#91745), [#​91746](openclaw/openclaw#91746), [#​91748](openclaw/openclaw#91748), [#​91749](openclaw/openclaw#91749), [#​91750](openclaw/openclaw#91750), [#​91751](openclaw/openclaw#91751), [#​91752](openclaw/openclaw#91752), [#​91763](openclaw/openclaw#91763), [#​89938](openclaw/openclaw#89938)) Thanks [@​joshavant](https://github.com/joshavant), [@​pgondhi987](https://github.com/pgondhi987), [@​mmaps](https://github.com/mmaps), [@​eleqtrizit](https://github.com/eleqtrizit), [@​shakkernerd](https://github.com/shakkernerd), and [@​drobison00](https://github.com/drobison00). - Telegram delivery is safer and more coherent: account-scoped topics route to the right agent, streamed text survives tool calls, `/compact` works on generic ingress, callback handling uses concrete APIs, draft chunking is shared, durable dispatch dedupe moved into the SDK, and unauthorized DM text stays out of cache and prompt context. ([#​91189](openclaw/openclaw#91189), [#​88682](openclaw/openclaw#88682), [#​89588](openclaw/openclaw#89588), [#​90212](openclaw/openclaw#90212), [#​91876](openclaw/openclaw#91876), [#​91874](openclaw/openclaw#91874), [#​91904](openclaw/openclaw#91904), [#​91478](openclaw/openclaw#91478), [#​91915](openclaw/openclaw#91915)) Thanks [@​codysai001](https://github.com/codysai001), [@​alexzhu0](https://github.com/alexzhu0), [@​joelnishanth](https://github.com/joelnishanth), [@​snowzlm](https://github.com/snowzlm), [@​obviyus](https://github.com/obviyus), and [@​sallyom](https://github.com/sallyom). - iMessage recovery and delivery now cover always-on inbound restart, durable echo markers, block streaming, idle approval discovery, hardened outbound transport, and actionable inbound startup diagnostics. ([#​91335](openclaw/openclaw#91335), [#​91449](openclaw/openclaw#91449), [#​88969](openclaw/openclaw#88969), [#​88530](openclaw/openclaw#88530), [#​91783](openclaw/openclaw#91783), [#​91785](openclaw/openclaw#91785)) Thanks [@​omarshahine](https://github.com/omarshahine), [@​jmissig](https://github.com/jmissig), and [@​colmbrogan](https://github.com/colmbrogan). - Browser and MCP connectivity gained existing-session CDP support, discovered WebSocket validation, default-profile `cdpUrl` handling, safer browser-output boundaries, Streamable HTTP loopback transport, corrected OAuth/SSE authorization handling, and broader schema compatibility. ([#​91422](openclaw/openclaw#91422), [#​89851](openclaw/openclaw#89851), [#​91736](openclaw/openclaw#91736), [#​91747](openclaw/openclaw#91747), [#​91451](openclaw/openclaw#91451), [#​80143](openclaw/openclaw#80143)) Thanks [@​pgondhi987](https://github.com/pgondhi987), [@​anagnorisis2peripeteia](https://github.com/anagnorisis2peripeteia), [@​lifuyue](https://github.com/lifuyue), [@​eleqtrizit](https://github.com/eleqtrizit), [@​LiuwqGit](https://github.com/LiuwqGit), and [@​HemantSudarshan](https://github.com/HemantSudarshan). - Control UI startup and first-reply latency are lower through cached model metadata, removal of the startup catalog wait, lazy slash-command loading, and first-event tracing with slow-reply diagnostics. ([#​91531](openclaw/openclaw#91531), [#​91538](openclaw/openclaw#91538), [#​91568](openclaw/openclaw#91568), [#​91583](openclaw/openclaw#91583), [#​91598](openclaw/openclaw#91598)) - Provider support expands with OpenRouter OAuth onboarding and Claude Fable 5 adaptive thinking, while Codex sessions keep correct compaction ownership, local models skip guardian review, dynamic tool progress normalizes cleanly, and Gemma 4 reasoning replay is preserved. ([#​91830](openclaw/openclaw#91830), [#​91882](openclaw/openclaw#91882), [#​91590](openclaw/openclaw#91590), [#​88630](openclaw/openclaw#88630), [#​88768](openclaw/openclaw#88768), [#​91696](openclaw/openclaw#91696)) Thanks [@​Patrick-Erichsen](https://github.com/Patrick-Erichsen), [@​joshavant](https://github.com/joshavant), [@​bdjben](https://github.com/bdjben), and [@​Coder-Wangyankun](https://github.com/Coder-Wangyankun). ##### Changes - CLI progress: emit Claude CLI commentary progress events and bridge inter-tool commentary into channel progress without exposing internal protocol scaffolding. ([#​89834](openclaw/openclaw#89834), [#​90883](openclaw/openclaw#90883)) Thanks [@​anagnorisis2peripeteia](https://github.com/anagnorisis2peripeteia). - Observability: allow trusted diagnostics channels to capture tool input/output content, add first-assistant-event traces, and warn on slow initial replies. ([#​91256](openclaw/openclaw#91256), [#​91568](openclaw/openclaw#91568), [#​91583](openclaw/openclaw#91583)) Thanks [@​amknight](https://github.com/amknight). - Plugins/ClawHub: dogfood reusable package publishing, let dry runs skip publish approval, allow declared installed trusted hooks, report managed plugin version drift, and warn instead of failing on retired Skill Workshop configuration. ([#​91574](openclaw/openclaw#91574), [#​91591](openclaw/openclaw#91591), [#​90004](openclaw/openclaw#90004), [#​90927](openclaw/openclaw#90927), [#​90838](openclaw/openclaw#90838)) Thanks [@​Patrick-Erichsen](https://github.com/Patrick-Erichsen), [@​brokemac79](https://github.com/brokemac79), and [@​lonexreb](https://github.com/lonexreb). - Memory/providers: move the local llama.cpp runtime into its provider plugin, batch embeddings across files, persist the agent model catalog cache, and keep QMD JSON search one-shot while filtering stale REM recall previews. ([#​91324](openclaw/openclaw#91324), [#​89138](openclaw/openclaw#89138), [#​90457](openclaw/openclaw#90457), [#​91837](openclaw/openclaw#91837), [#​91851](openclaw/openclaw#91851)) Thanks [@​osolmaz](https://github.com/osolmaz), [@​mushuiyu886](https://github.com/mushuiyu886), [@​ai-hpc](https://github.com/ai-hpc), and [@​TurboTheTurtle](https://github.com/TurboTheTurtle). - Channels/mobile: add the QQBot group mention toggle, improve iPad and iPhone control surfaces, and expose the active connection host in the TUI footer. ([#​91423](openclaw/openclaw#91423), [#​91557](openclaw/openclaw#91557), [#​89909](openclaw/openclaw#89909)) Thanks [@​cxyhhhhh](https://github.com/cxyhhhhh), [@​Solvely-Colin](https://github.com/Solvely-Colin), and [@​baskduf](https://github.com/baskduf). - Performance: prewarm TUI runtime plugins, deduplicate plugin auto-enable fanout, trim dense text-delta snapshots, and reuse prepared startup model metadata. ([#​90782](openclaw/openclaw#90782), [#​89978](openclaw/openclaw#89978), [#​91580](openclaw/openclaw#91580), [#​91531](openclaw/openclaw#91531)) Thanks [@​RomneyDa](https://github.com/RomneyDa) and [@​ai-hpc](https://github.com/ai-hpc). ##### Fixes - Agent/session recovery: drop stale approval follow-ups after session rebind, remove drained reply-queue items by identity, recover stale main and visible replies, preserve Codex context-engine compaction ownership, lower the default compaction timeout to 180 seconds while respecting explicit configuration, and keep provider-failure terminal lifecycle state correct. ([#​85679](openclaw/openclaw#85679), [#​91450](openclaw/openclaw#91450), [#​91566](openclaw/openclaw#91566), [#​91840](openclaw/openclaw#91840), [#​91590](openclaw/openclaw#91590), [#​91361](openclaw/openclaw#91361), [#​91895](openclaw/openclaw#91895)) Thanks [@​openperf](https://github.com/openperf), [@​yetval](https://github.com/yetval), [@​joshavant](https://github.com/joshavant), [@​wangmiao0668000666](https://github.com/wangmiao0668000666), and [@​TurboTheTurtle](https://github.com/TurboTheTurtle). - User-visible content boundaries: suppress Codex/Harmony protocol artifacts, neutralize browser and LanceDB memory media directives, redact transcript images, and preserve native `/compact` replies through source suppression. ([#​89151](openclaw/openclaw#89151), [#​91422](openclaw/openclaw#91422), [#​91425](openclaw/openclaw#91425), [#​91529](openclaw/openclaw#91529), [#​90212](openclaw/openclaw#90212)) Thanks [@​joelnishanth](https://github.com/joelnishanth), [@​pgondhi987](https://github.com/pgondhi987), [@​joshavant](https://github.com/joshavant), and [@​snowzlm](https://github.com/snowzlm). - Channel delivery: keep WhatsApp captured replies attached to the successor controller after restart, retry Feishu rate limits, preserve Mattermost thread replies, canonicalize LINE webhook paths, restore Discord reply hydration and runtime timeout exports, and show OpenAI Realtime WebRTC assistant transcripts. ([#​85823](openclaw/openclaw#85823), [#​89659](openclaw/openclaw#89659), [#​91684](openclaw/openclaw#91684), [#​91649](openclaw/openclaw#91649), [#​90263](openclaw/openclaw#90263), [#​91686](openclaw/openclaw#91686), [#​90426](openclaw/openclaw#90426)) Thanks [@​itsuzef](https://github.com/itsuzef), [@​ladygege](https://github.com/ladygege), [@​jacobtomlinson](https://github.com/jacobtomlinson), [@​fuller-stack-dev](https://github.com/fuller-stack-dev), and [@​shushushv](https://github.com/shushushv). - Cron: cancel active task runs cleanly, preserve terminal timeout/cancel state, and recover no-deliver tool warnings instead of silently losing the outcome. ([#​90666](openclaw/openclaw#90666), [#​90678](openclaw/openclaw#90678)) Thanks [@​ai-hpc](https://github.com/ai-hpc). - Gateway/config/auth: share the approval runtime socket token, replace arrays explicitly in `config.patch`, skip the deleted-agent guard only for valid ACP harness sessions, surface headless LaunchAgent state, verify SQLite auth migration before cleanup, and arm QMD startup maintenance. ([#​87105](openclaw/openclaw#87105), [#​91551](openclaw/openclaw#91551), [#​91219](openclaw/openclaw#91219), [#​91614](openclaw/openclaw#91614), [#​91740](openclaw/openclaw#91740), [#​91978](openclaw/openclaw#91978)) Thanks [@​fuller-stack-dev](https://github.com/fuller-stack-dev) and [@​scotthuang](https://github.com/scotthuang). - Providers/Codex: clarify quota errors, restore the Codex synthetic usage line, canonicalize Codex protocol assets, require API-key auth for realtime voice, normalize ACP model refs, preserve Gemma 4 `reasoning_content`, and avoid guardian review for local models. ([#​91390](openclaw/openclaw#91390), [#​91709](openclaw/openclaw#91709), [#​91507](openclaw/openclaw#91507), [#​91567](openclaw/openclaw#91567), [#​88630](openclaw/openclaw#88630), [#​91696](openclaw/openclaw#91696)) Thanks [@​hxy91819](https://github.com/hxy91819), [@​brokemac79](https://github.com/brokemac79), [@​RomneyDa](https://github.com/RomneyDa), [@​joshavant](https://github.com/joshavant), and [@​Coder-Wangyankun](https://github.com/Coder-Wangyankun). - Updates/builds: recover package Gateway restarts after refresh failure, expose plugin convergence repair, fall back to Corepack in PATH-less pnpm environments, seed the correct Docker store packages, and keep ClawHub dry-run and publish paths reusable. ([#​91581](openclaw/openclaw#91581), [#​91599](openclaw/openclaw#91599), [#​91547](openclaw/openclaw#91547), [#​91591](openclaw/openclaw#91591)) Thanks [@​fuller-stack-dev](https://github.com/fuller-stack-dev), [@​sallyom](https://github.com/sallyom), and [@​Patrick-Erichsen](https://github.com/Patrick-Erichsen). - UI: require explicit user intent before opening chat sessions and drain restored chat queues after session switches. ([#​91480](openclaw/openclaw#91480)) Thanks [@​TurboTheTurtle](https://github.com/TurboTheTurtle). - Android: avoid the `dataSync` foreground-service type for persistent nodes. ([#​80082](openclaw/openclaw#80082)) Thanks [@​davelutztx](https://github.com/davelutztx). - Native hooks: bound relay lifetimes so abandoned native hook connections cannot linger indefinitely. ([#​91550](openclaw/openclaw#91550)) Thanks [@​joshavant](https://github.com/joshavant). </details> --- ### Configuration 📅 **Schedule**: Branch creation - At any time (no schedule defined), Automerge - At any time (no schedule defined). 🚦 **Automerge**: Disabled by config. Please merge this manually once you are satisfied. ♻ **Rebasing**: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox. 🔕 **Ignore**: Close this PR and you won't be reminded about these updates again. --- - [ ] <!-- rebase-check -->If you want to rebase/retry this PR, check this box --- This PR has been generated by [Renovate Bot](https://github.com/renovatebot/renovate). <!--renovate-debug:eyJjcmVhdGVkSW5WZXIiOiI0My4xMDEuMSIsInVwZGF0ZWRJblZlciI6IjQzLjEwMS4xIiwidGFyZ2V0QnJhbmNoIjoibWFpbiIsImxhYmVscyI6WyJyZW5vdmF0ZS9jb250YWluZXIiLCJ0eXBlL3BhdGNoIl19--> Reviewed-on: https://git.erwanleboucher.dev/eleboucher/homelab/pulls/1040
…ter restart (openclaw#85823) Merged via squash. Prepared head SHA: 5df8c79 Co-authored-by: itsuzef <[email protected]> Co-authored-by: mcaxtr <[email protected]> Reviewed-by: @mcaxtr
Summary
When the gateway's
channel-health-monitortears down a WhatsAppConnectionControllermid-run, any in-flight inbound message's capturedreply()closure is left bound to the now-stalesocketRefof the shutdown controller.sendTrackedMessage's retry loop only knows how to wait for that same controller'ssocketRefto be repopulated, but the successor controller constructs its own freshsocketRefobject — so the captured reply throwsRECONNECT_IN_PROGRESS_ERRORindefinitely.Visible symptom: the agent silently fails to reply to a WhatsApp message after a transient 408 disconnect that triggered a health-monitor restart. The user's message shows "read", then nothing.
Forensic reproducer
Observed in production 2026-05-22:
Fix
WhatsAppConnectionControllerHandle(extensions/whatsapp/src/connection-controller-registry.ts) withgetCurrentSock()andgetSelfIdentity().WhatsAppConnectionControllerimplements both from itssocketRef.attachWebInboxToSocket'sgetCurrentSock()helper falls back to the registered successor's socket when the localsocketRef.currentis null, ANDidentitiesOverlap()confirms the successor's{jid, lid}self-identity matches the original socket's self-identity captured at attach time. If the registered controller is for a different WhatsApp identity (in-place relink), it's not authenticated, or the original socket was never authenticated, the fallback returns null and the caller fails closed.The fallback fires only when the local socket is gone, so the steady-state hot path is unchanged. All current
getCurrentSock()callers —sendTrackedMessage,groupMetadata,readMessages— benefit, so post-restart group mentions and read receipts also recover, not just plain text sends.Real behavior proof
Two regression tests demonstrate the fix end-to-end through the production code path (
attachWebInboxToSocket→sendTrackedMessage→getCurrentSock→ registry →sock.sendMessage):The first test reproduces the full lifecycle of the production forensic above (controller A handles inbound → shutdown → B registered → captured reply routes through B's socket). The second test asserts the session-safety guard: when B is registered under the same
accountIdbut logged in as a different number, the captured reply throwsRECONNECT_IN_PROGRESS_ERRORand B'ssendMessageis never called.These are not mocks of the changed function — they exercise the real
attachWebInboxToSocket→sendTrackedMessage→getCurrentSock→getRegisteredWhatsAppConnectionControllerchain.Trade-off worth maintainer eyes
identitiesOverlap()compares{jid, lid, e164}directly without consulting the auth-dir-backed PN↔LID reverse mapping. If the original socket exposed only one form (PN JID) and the successor exposes only the other (LID), the overlap would be false-negative — captured replies would still throw rather than route through the new socket. The common case is thatsock.userhas bothidandlidpopulated, so the overlap succeeds.If maintainers want belt-and-suspenders here, I can wire
resolveComparableIdentity(authDir)into the handle so the e164 derivation is identical on both sides — happy to do that in a follow-up.Test plan
pnpm test extensions/whatsapp/src/monitor-inbox.behavior.test.ts— 63/63 passed (2 new VE-513 tests)pnpm test extensions/whatsapp/src/connection-controller-registry.test.ts— 1/1 passedpnpm exec oxfmt --check— cleanpnpm lint:extensions— cleanpnpm check:changed— full lane green (typecheck, lint, import cycles, deps guards)codex review --base upstream/main— 5 iterations addressed. Iter 1 (group meta + read receipts) fixed by lifting fallback intogetCurrentSock. Iter 2 (authDir match insufficient) fixed by switching to self-identity. Iter 3 (self id raw string compare) fixed by switching toidentitiesOverlap()helper. Iter 4 + Iter 5 (P2 PN/LID edge case) documented as trade-off above.Note on existing CI failures
checks-node-core-fastandinbound.media.test.tsfailures are preexisting onupstream/main(fcb9c46af0), not caused by this PR. Theinbound.mediafailures (WhatsApp runtime not initialized) reproduce on a clean stash of upstream/main with no diff applied. TheReal behavior proofandchecks-node-agentic-control-plane-runtimefailures are the standard fork-PR secret-availability issues (also seen on PR #85777).AI disclosure
Authored with Claude Code (Opus 4.7) assistance. Fully tested. Author confirms understanding of the change.