Repository navigation
fix(whatsapp): migrate unscoped credentials through Doctor - #163203
Conversation
|
Codex review: blocked before merge. Reviewed October 3, 2026, 10:32 AM ET / 14:32 UTC (Revision 11). ClawSweeper reviewWhat this changesMoves legacy WhatsApp credentials through Doctor with verified backups and recovery receipts, removes implicit runtime fallback, and refuses retired configuration before update repair. Merge readiness⛔ Blocked before merge - 3 items remain This remains useful work: current main and the latest release retain implicit shared-root credential fallback. No concrete introduced correctness defect was found, but the WhatsApp-specific upgrade evidence remains incomplete despite passing current-head CI. Priority: P2 Review scores
Verification
How this fits togetherThe WhatsApp plugin resolves account credentials used to connect linked devices. Doctor normalizes older credential layouts before runtime starts, while update admission checks whether the candidate can safely accept existing configuration. flowchart TD
A[Existing configuration and credentials] --> B[Candidate update admission]
B --> C{Retired settings present?}
C -->|Yes| D[Preserve installation and explain recovery]
C -->|No| E[WhatsApp Doctor migration]
E --> F[Private backups and SQLite receipts]
E --> G[Canonical account credentials]
G --> H[WhatsApp runtime]
Before merge
Agent review detailsSecurityNone. PR surfaceSource +231, Tests +344, Docs +9. Total +584 across 17 files. View PR surface stats
Review metrics
Stored data modelPersistent data-model change detected: Merge-risk optionsMaintainer options:
Technical reviewBest possible solution: Keep credential normalization with WhatsApp Doctor and establish published-install upgrade compatibility before removing runtime fallback. Do we have a high-confidence way to reproduce the issue? Yes for the source mechanism: current main selects implicit shared-root credentials and migrates through independent file plans. A failing current-main crash or upgrade scenario was not executed during this read-only review. Is this the best way to solve the issue? Yes, the plugin-owned Doctor migration is the appropriate repair boundary and reuses existing backup, authority, and storage owners; upgrade compatibility still needs the scoped evidence already prepared. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning medium; reviewed against b94391aa2c5a. LabelsLabel changes: No label changes. Label justifications:
EvidenceWhat I checked:
Likely related people:
Rank-up movesOptional improvements that raise the rating; they are not merge blockers.
Rating scale
Overall follows the weaker of proof and patch quality. Workflow
HistoryReview history (10 earlier review cycles; latest 8 shown)
|
|
🦞👀 Pull request received. I will update this pull request when review starts. ClawSweeper review completeClawSweeper finished reviewing this revision. The review result is being finalized. |
dcc1dae to
3f9acb0
Compare
3f9acb0 to
2a79d1f
Compare
…163203) Move shared-root credential import into WhatsApp's existing Doctor owner. Preserve exact private backups and explicit account roots, verify complete destination bytes before source removal, and retain durable replay protection across interrupted migration and logout. Runtime uses canonical account directories or explicit overrides. Check retired source configuration before plugin repair planning so the candidate refuses before copied-state snapshots or package mutation. Independent P2 review, exact-head CI, strict negative and positive admission controls, and the published 2026.9.7 update cell passed. The package/config/state cell used --no-restart and a version-only candidate fixture with unchanged runtime bytes; it does not claim live WhatsApp messaging. Proof, costs, retention history, and behavior changes are in the PR. Production +321/-90/net +231 under the credential exception.
What Problem This Solves
WhatsApp runtime implicitly selected shared-root credentials when the default account directory had none. The old Doctor move plan lacked a complete verified backup and reliable recovery for interrupted claims or incomplete destination sets. Published OpenClaw 2026.9.7 still selects and writes this credential layout, so its migration remains supported.
Why This Change Was Made
WhatsApp's existing Doctor artifact now owns the import. It saves exact private
.migratedbackups, verifies the complete destination before removing sources, and records durable intent in existing plugin SQLite state. Receipts bind the source credential digest to the expected destination fingerprint without storing credential bytes. Changed or missing destinations require recovery instead of silently relinking an account after logout. Explicit accountauthDirsettings remain authoritative; conflicting identities and orphaned key files remain preserved. Each filesystem effect and receipt commit rechecks the existing offline migration authority.Runtime account resolution and auth discovery consume canonical account directories or explicit overrides. The credential repair adds no core migration module, storage owner, schema, or protocol.
The published-driver cell exposed an admission gap: an older installed plugin could validate or repair a setting that the candidate had retired, so admission emitted a warning and a later Doctor refused it after snapshotting. Candidate admission now checks the original source with the existing shared retired-config detector before planning any plugin repair. This adds nine production lines and returns the existing typed
invalid-configrefusal before mutable execution.Production +321 / -90 / net +231, refreshed from the complete paginated PR files API at head
e93674677dcfeb305e84092001c752e7dc94184b(17 files, 8 production files, all pages consumed). The measurement coverssrc/**andextensions/**, excluding tests, test support/helpers/utilities, e2e, and fixtures. The preference retirement contributes +4 / -27 / net -23. Remaining growth protects credentials, key material, and logout across crashes under the durable-data exception.The rebase preserves main's account-routing warnings, Telegram/Nextcloud/Talk retirement rules, Teams include-persistence tests, and OAuth retirement documentation. The three credential commits are patch-identical; all six WhatsApp production owner files have the same blobs as the prior
3f9acb0head. The three conflicts were adjacent additions in the shared detector, test file, and migration docs. Main's behavior is retained alongside WhatsApp's additions. Earlier overlaps with #161466 and #124305 concern separate account-policy fields.User Impact
The obsolete WhatsApp
exposeErrorTextcleanup is removed as a same-owner offset. Its schema/type was introduced and removed on April 29; later published schemas only stripped the already ignored preference. The existing shared retired-config detector now names root and account occurrences before backup recovery or writes, including explicitfalsevalues during an update. Remove the reported key before retrying; doing so does not change error delivery. Alternatively, OpenClaw 2026.9.5 Doctor contains the old cleanup. Current Doctor preserves the authored config and gives that explicit bridge instruction instead of repeatedly suggesting a repair it no longer performs.The installed
2026.9.7updater runs first. The completed cell installed published core and its WhatsApp package, seedsexposeErrorText: falseat the root and declared default account, and runs that unmodifiedopenclaw updateagainst the exact candidate artifacts. It verified a candidate-owned protocol-1invalid-configrefusal with the2026.9.5remedy, unchanged config/credential/package bytes and plugin records, and no snapshot, activation, or rollback. The fixture then removed only those synthetic ignored fields and completed the credential update.Before any manual candidate Doctor, the retry verified installed artifact identities, executed credential migration, canonical and backup bytes, private permissions, and unrelated OAuth preservation. A second Doctor confirmed idempotence. The fixture uses the repository's version-only next-version transformation and checks that runtime archive members remain byte-identical; it publishes nothing and does not claim same-version replacement coverage.
A separate artifact step loaded the candidate's packed Doctor and auth-presence surfaces against the real published
2026.9.7SDK. Canonical-state loading retains that API compatibility path. Legacy repair additionally requires the existing offline authority, backup helper, and keyed-store binding; an older host lacking them receives update-core guidance before any write. Direct plugin replacement requiresopenclaw doctor --fix.Evidence
Current head:
e93674677dcfeb305e84092001c752e7dc94184b; tree:0dc40ddac043a0254202e4dd174cc79d92df3b10; parent:2a79d1ff1201be7c4378b10e851bf24cb968c7aa; captured main base:260a31989937cb1ac3d2d0a2280a65ef5312a81a.git diff --checkpassed. Fresh independent Codex P2 review of the nine-line admission fix and two real CLI-entry regressions is scoped-clean. The earlier rebase retained main's detector/test/docs additions and all three credential commits unchanged.2a79d1ff1201be7c4378b10e851bf24cb968c7aa; its hosted published-driver cell was skipped. This is not current-head CI or a passing WhatsApp update cell.cbx_ff09028debc1, runrun_3307afc26ac578dcfac4ed90471f6d2e, built the exact2a79d1fpackage successfully in 929s, after frozen install in 11s. All 22 WhatsApp Doctor-contract tests passed in 7s; the retired-config refusal file passed in 140s (command wall times). The published-driver stage failed after 319s at its strict early-refusal assertion.run_3765c1f9b5284eb92b99e64c865a7464confirmed protocol-1 admission returnedadmitwith a config warning, thencandidate-state-snapshotran andcandidate-doctorfailed on the two retired WhatsApp fields with the2026.9.5remedy. This was a real late-admission defect, not merely an error-label difference. The later preservation assertions were not reached. Neither the failed artifact nor the installed driver was patched, and no assertion was relaxed.37007407911, at credential head669161610f341793e8fca66f3fb62048bc0307d0, passed all 15 migration cases in 3.093s reported test time; the two-file database-worker shard took 54.96s including transforms. These remain historical measurements.Current-head CI and the complete published-driver cell passed. Exact-head hosted CI
37128643488passed ate936746, including its hosted published-driver job (11m24s). The separate strict cell ran on Hetzner leasecbx_ff09028debc1, runrun_8a7599227d4cce69f8c6e3f4e3276d89, with frozen install first and a newly builte936746artifact. The entire remote command took 2227.702s; package/integrity checks took 910.11s and the published-driver phase took 902s.The two new real CLI-entry admission cases failed on
2a79d1fspecifically because old code admitted the retired configuration with exit 0 (44.91s command wall). They passed on this candidate (46.67s); the full admission owner passed (39.42s), all 22 WhatsApp Doctor-contract tests passed (6.96s), and the retired-config refusal owner passed (139.01s). These controls preserved the same assertions; the dirty baseline-plus-test worktree was never packaged.The actual unmodified published 2026.9.7 updater first returned the candidate-owned protocol-1
invalid-configrefusal. It preserved config, credential and package bytes and plugin records, with no copied-state snapshot, activation, or rollback. After removing only the synthetic ignored preference keys, the credential update completed in 644s; installed routing/artifact and first-hop credential assertions passed before manual Doctor. Repeated Doctor passed in 29s, followed by exact idempotence assertions and update status. The candidate's packed Doctor/auth-presence surfaces also loaded against the real published 9.7 SDK.This is a
--no-restartpackage/config/state cell, not a live WhatsApp messaging or running-Gateway PID-preservation claim. The version-only fixture produced2026.9.9-first-hop.0, verifying unchanged runtime members; nothing was published and same-version replacement is not claimed. Earlier v5 failure evidence remains preserved and is not relabeled as success.Independent P2 review of the final source and v6 proof was clean. No local tests or builds ran.