fix(whatsapp): restart listener on selfChatMode config change#93873
Conversation
|
Codex review: needs real behavior proof before merge. Reviewed June 19, 2026, 8:37 AM ET / 12:37 UTC. Summary PR surface: Source 0, Tests +55. Total +55 across 4 files. Reproducibility: yes. at source level: current main classifies Review metrics: 1 noteworthy metric.
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:
Proof guidance:
Mantis proof suggestion Risk before merge
Maintainer options:
Next step before merge
Security Review detailsBest possible solution: Land the narrow plugin-owned reload prefix after redacted live WhatsApp restart/presence proof or explicit maintainer acceptance of deterministic source-level proof. Do we have a high-confidence way to reproduce the issue? Yes at source level: current main classifies Is this the best way to solve the issue? Yes: plugin-owned reload metadata is the narrowest maintainable fix, and the PR adds focused planner/handler coverage. The remaining blocker is runtime proof or maintainer risk acceptance, not a better code location. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning high; reviewed against aea208f0ac51. Label changesLabel justifications:
Evidence reviewedPR surface: Source 0, Tests +55. Total +55 across 4 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 re-review |
|
🦞🧹 I asked ClawSweeper to review this item again. Re-review progress:
|
83b809b to
dfa8767
Compare
dfa8767 to
0ad36af
Compare
|
Land-ready verification for exact head
Known proof gap: no live WhatsApp session is configured; deterministic planner-to-handler integration proves the listener stop/start contract. |
7b06a7f to
6fe096f
Compare
Switching WhatsApp from personal phone (selfChatMode: true) to separate phone (selfChatMode: false) now triggers a channel restart, so the connect-time presence value is recalculated. The selfChatMode path was previously swallowed by the broad channels.whatsapp noop prefix. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Matches the production reload metadata after adding channels.whatsapp.selfChatMode to the configPrefixes array. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
6fe096f to
d85f604
Compare
|
Merged via squash.
Thanks @xialonglee! |
Root Cause
extensions/whatsapp/src/shared.ts:185listschannels.whatsappas anoopPrefix, so changingchannels.whatsapp.selfChatModedoes not trigger a WhatsApp listener restart; the connect-time presence value stays stale until a full restart. ThenoopPrefixesrules are checked afterconfigPrefixesrules in the reload planner, but the specificselfChatModekey was never listed inconfigPrefixes, so it fell through to the broadchannels.whatsappnoop match.Summary
selfChatModeconfig changes were silently ignored as hot no-ops, leaving stale presence until a full gateway restart."channels.whatsapp.selfChatMode"to theconfigPrefixesarray in the WhatsApp plugin reload config, matching the existing pattern for"channels.whatsapp.accounts", so the channel restarts whenselfChatModechanges.Verification
pnpm test extensions/whatsapp/index.test.ts— 3/3 passedpnpm test src/gateway/config-reload.test.ts— 352/352 passed (total 355/355)Real behavior proof
Behavior addressed: WhatsApp
selfChatModeconfig change did not trigger a WhatsApp channel restart, leaving stale presence behavior until a full gateway restart.Real environment tested: Linux (4.19.112-2.el8.x86_64), Node v24.15.0, branch
fix/issue-86888-whatsapp-selfchatmode-reloadat commit83b809b3a2.Exact steps or command run after this patch:
Evidence after fix:
Observed result after fix: All 355 tests pass. The new test
"restarts the WhatsApp channel when selfChatMode changes (configPrefix wins over broad noop prefix)"confirms that changingchannels.whatsapp.selfChatModetriggers a channel restart (not a restartGateway or noop), validating the specific prefix match ordering inbuildGatewayReloadPlan. The existing test"keeps other channels.whatsapp.* changes as hot no-ops"still passes, confirming that otherchannels.whatsapp.*paths remain unaffected.What was not tested: Full E2E WhatsApp connection test (requires real WhatsApp credentials). The fix relies on the same
reload.configPrefixespattern already proven bychannels.whatsapp.accountsin production.