Repository navigation
fix(whatsapp): stop reconnecting after terminal retry exhaustion - #118659
Conversation
|
@clawsweeper re-review |
|
🦞🧹 I asked ClawSweeper to review this item again. Re-review progress:
|
|
Codex review: needs maintainer review before merge. Reviewed August 3, 2026, 9:11 AM ET / 13:11 UTC. ClawSweeper reviewWhat this changesThe branch records exhausted WhatsApp reconnect retries as a blocked terminal lifecycle so Gateway preserves the original error and does not restart the channel again. Merge readinessThis is a focused, correct repair for an owned WhatsApp lifecycle bug. It should remain open for protected maintainer landing because the branch is behind current Priority: P1 Review scores
Verification
How this fits togetherThe WhatsApp plugin converts socket-close outcomes into a channel runtime status, which Gateway then uses to decide whether to restart the account and what diagnostic to show operators. This change corrects the lifecycle fact at the plugin owner before Gateway consumes it. flowchart LR
A[WhatsApp socket closes] --> B[Connection retry controller]
B --> C[WhatsApp status lifecycle]
C --> D[Gateway restart policy]
D --> E[Channel status and doctor guidance]
E --> F[Operator recovery]
Decision needed
Why: The patch is correct and proof-backed, but the protected Before merge
Agent review detailsSecurityNone. PR surfaceSource -1, Tests +65. Total +64 across 2 files. View PR surface stats
Review metrics
Merge-risk optionsMaintainer options:
Technical reviewBest possible solution: Merge the current clean result after required hosted checks confirm it, keeping retry-exhaustion classification and terminal restart policy owned by the WhatsApp plugin. Do we have a high-confidence way to reproduce the issue? Yes, from source: reach the configured reconnect maximum in Is this the best way to solve the issue? Yes. The patch records the terminal fact at the WhatsApp lifecycle owner and lets existing Gateway terminal handling consume it, rather than adding a downstream retry exception. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning high; reviewed against 096c929ecf6e. LabelsLabel justifications:
EvidenceWhat I checked:
Likely related people:
Rating scale
Overall follows the weaker of proof and patch quality. Workflow
HistoryReview history (1 earlier review cycle)
|
|
Merged via squash.
|
* origin/main: (57 commits) fix(media): fall back when providers return empty output (#118660) fix(nextcloud-talk): allow bounded parallel room deliveries (#118692) test(state): reuse current agent database fixture (#118677) fix(scripts): bound check-file-utils git lookup (#111582) fix(slack): scope interactive conversation bindings safely (#118662) fix(agents): avoid false compaction after mid-turn precheck (#117963) fix(ui): show original filename on chat history attachment cards instead of managed UUID suffix (#118628) fix(whatsapp): preserve terminal retry exhaustion lifecycle (#118659) fix(doctor): audit every agent workspace (#111840) fix(release): skip unavailable Buzz on frozen candidates (#118670) fix(ui): surface onboarding and pairing clipboard failures (#118651) fix(config): stop plugin schemas rejecting the channel key core writes (#117992) test(memory): isolate wiki plugin fixtures (#118654) fix(line): clear default access token when removing account (#118055) feat: enable rich setup controls in custodian chat (#114631) test(ui): reuse responsive browser fixtures (#118655) chore(tui): stabilize queued-turn admission in Gateway PTY test (#118638) fix(xai): classify exhausted credits as billing (#118615) fix(otel): fail closed when configured TLS material is invalid (#118648) fix(cli): preserve gateway request errors in health JSON (#118645) ...
…#118659) Co-authored-by: Peter Steinberger <[email protected]>
* origin/main: (57 commits) fix(media): fall back when providers return empty output (openclaw#118660) fix(nextcloud-talk): allow bounded parallel room deliveries (openclaw#118692) test(state): reuse current agent database fixture (openclaw#118677) fix(scripts): bound check-file-utils git lookup (openclaw#111582) fix(slack): scope interactive conversation bindings safely (openclaw#118662) fix(agents): avoid false compaction after mid-turn precheck (openclaw#117963) fix(ui): show original filename on chat history attachment cards instead of managed UUID suffix (openclaw#118628) fix(whatsapp): preserve terminal retry exhaustion lifecycle (openclaw#118659) fix(doctor): audit every agent workspace (openclaw#111840) fix(release): skip unavailable Buzz on frozen candidates (openclaw#118670) fix(ui): surface onboarding and pairing clipboard failures (openclaw#118651) fix(config): stop plugin schemas rejecting the channel key core writes (openclaw#117992) test(memory): isolate wiki plugin fixtures (openclaw#118654) fix(line): clear default access token when removing account (openclaw#118055) feat: enable rich setup controls in custodian chat (openclaw#114631) test(ui): reuse responsive browser fixtures (openclaw#118655) chore(tui): stabilize queued-turn admission in Gateway PTY test (openclaw#118638) fix(xai): classify exhausted credits as billing (openclaw#118615) fix(otel): fail closed when configured TLS material is invalid (openclaw#118648) fix(cli): preserve gateway request errors in health JSON (openclaw#118645) ...
What Problem This Solves
After WhatsApp exhausted its bounded reconnect budget, its connection owner stopped correctly but the separate status owner did not record a terminal lifecycle. The production Gateway interpreted that clean exit as restartable, began another retry cycle, and could replace the original useful error with a generic disconnect.
Why This Change Was Made
The canonical terminal fact already belongs to the WhatsApp lifecycle owner. Map retry exhaustion to its existing
blockedlifecycle and deriveterminalDisconnectfrom that authoritative fact instead of separately guessing from legacy health labels. Ordinary repeated shutdown and recovery remain nonterminal. The production refactor removes one net line and introduces no Gateway/core, credential, config/default, dependency, SDK, schema, or protocol changes.User Impact
Operators no longer get an endless WhatsApp reconnect storm after the configured retry budget is exhausted. Real
openclaw channels statusretains the original upstream failure and existing actionableopenclaw doctorguidance; intentional stops and manual recovery keep working.Existing shared Gateway terminal cleanup resets its generic reconnect-attempt projection to zero. The actual WhatsApp owner still exhausts all 12 attempts; this unchanged projection is not represented as retaining the owner count.
Evidence
gpt-5.6-sol/ high / P3 / no-web autoreview: clean, confidence 0.94; pinned TruffleHog 3.96.0: clean.Real behavior proof
An actual authenticated loopback production Gateway, its real
channels.statusWebSocket RPC, and the public Commander CLI exercised the full owner-to-operator path on exact commit2f5222eb6e2dd51d6660734a73d17af7727683cb:lifecycle: blocked,terminalDisconnect: true, and the originalwhatsapp-proof-2f522: upstream websocket timed outerror.openclaw doctorremediation.Maintainer decision
2f5222eb6e2dd51d6660734a73d17af7727683cbafter all hosted checks and the completed ClawSweeper review pass.openclaw/ci-gatepassed and authorizes the repository-native preparation and landing workflow.