Skip to content

fix: restore startup with legacy WhatsApp allowlists - #110217

Merged
jalehman merged 1 commit into
openclaw:release/2026.7.2from
VACInc:port/release-2026.7.2-109876-108453
Jul 17, 2026
Merged

jalehman merged 1 commit into
openclaw:release/2026.7.2from
VACInc:port/release-2026.7.2-109876-108453

Conversation

@VACInc

@VACInc VACInc commented Jul 17, 2026 •

Copy link
Copy Markdown
Member

Related: #108421

Additional instructions

MUST: Keep Allow edits from maintainers enabled for this PR so maintainers
can help update the branch when needed.

Summary

What Problem This Solves

Fixes an issue where existing WhatsApp users with the legacy default-account
whatsapp-default-allowFrom.json allowlist could have Gateway startup blocked
during state migration on the 2026.7.2 beta train.

Source fix: #108453

Root Cause

Before this fix, src/infra/state-migrations.channel-pairing.ts could resolve a
legacy *-default-allowFrom.json filename only through configured channel or
account metadata. An upgraded install may legitimately have
credentials/whatsapp-default-allowFrom.json without any channels.whatsapp
config. The migration therefore classified whatsapp/default as unresolved,
left the file in place, and returned a warning. The startup migration guard in
src/commands/doctor-config-preflight.ts treats any unresolved migration
warning as a readiness blocker, producing the #108421 startup failure.

The backport recognizes the canonical default account only when the parsed
channel is in the bundled channel registry. This repairs the shipped WhatsApp
upgrade state without extending default-account inference to external channels.

Why This Change Was Made

This is the operator-selected backport of main commit 5e4107400963 from
#108453. It lets state migration associate an explicit legacy default-account
allowlist with its bundled channel while preserving unresolved handling for
external channels. The cherry-pick applied without conflicts and preserved
Steffen Möller's original authorship.

#109876 was also evaluated for this backport set, but its commit
62407b36d780 is already an ancestor of release/2026.7.2. This PR therefore
carries only the legacy allowlist startup fix.

User Impact

Operators upgrading an existing WhatsApp setup can start the Gateway without
manually removing or rewriting the legacy default-account allowlist first.

This is a focused beta-train backport. Maintainers should land it through the
reviewed non-main release-branch flow; scripts/pr prepare/merge is not used
for release-branch PRs.

Real behavior proof

The exact release base without the cherry-pick and this PR head were each built
from source. Each run used a fresh synthetic OpenClaw state directory containing
credentials/whatsapp-default-allowFrom.json and a minimal local Gateway config
with no channels.whatsapp key. The base build failed closed before readiness;
the PR build migrated the allowlist into shared SQLite and reported ready. A
second startup was clean. A separate synthetic external-channel fixture remained
unresolved and on disk.

No real account, phone number, token, or user state was used. Paths below are
redacted and all allowlist values are reserved synthetic examples.

Evidence

Runtime context:

  • Release base without pick: 95c4b78283be3c193a7cb921b2c8def3689e57b1
  • Ported candidate: f8ed872d6ccee2e5c155cd16c07b14e18bf51633
  • Linux source checkout, Node v25.9.0, pnpm 11.2.2
  • Both SHAs: pnpm install --frozen-lockfile as needed, then pnpm build

Gateway command for each positive/base case:

$ OPENCLAW_STATE_DIR=<STATE_DIR> OPENCLAW_CONFIG_PATH=<STATE_DIR>/openclaw.json \
    node openclaw.mjs gateway run --port <PORT> --bind loopback

Redacted transcript, release branch without the pick:

candidate_sha=f8ed872d6ccee2e5c155cd16c07b14e18bf51633
release_without_pick_sha=95c4b78283be3c193a7cb921b2c8def3689e57b1
candidate_build=PASS
release_without_pick_build=PASS
fixture=credentials/whatsapp-default-allowFrom.json
channels.whatsapp_present=false
gateway_exit=1
- Legacy channel allowFrom channel/account is unresolved; left in place at <STATE_DIR>/credentials/whatsapp-default-allowFrom.json
[openclaw] Reason: OpenClaw startup migrations did not complete cleanly; refusing to report the gateway ready.
readyz=UNAVAILABLE
legacy_file=LEFT_IN_PLACE

Redacted transcript, first startup from this PR's build:

fixture=credentials/whatsapp-default-allowFrom.json
channels.whatsapp_present=false
- Migrated 3 whatsapp/default allowFrom entries → shared SQLite state
legacy_file=REMOVED
sqlite_rows=[{"channel_key":"whatsapp","account_id":"default","entry":"12025550101"},{"channel_key":"whatsapp","account_id":"default","entry":"12025550102"},{"channel_key":"whatsapp","account_id":"default","entry":"12025550103"}]
readyz={"ready":true,"failing":[],"uptimeMs":491}

Redacted transcript, second startup from the same migrated state:

migration_or_unresolved_messages=NONE
readyz={"ready":true,"failing":[],"uptimeMs":732}

External-channel negative case:

$ OPENCLAW_STATE_DIR=<STATE_DIR> OPENCLAW_CONFIG_PATH=<STATE_DIR>/openclaw.json \
    node openclaw.mjs doctor --non-interactive --fix
doctor_exit=0
- Legacy channel allowFrom channel/account is unresolved; left in place at <STATE_DIR>/credentials/custom-channel-default-allowFrom.json
legacy_file=LEFT_IN_PLACE
sqlite_row_count=0

Focused automated proof:

  • node scripts/run-vitest.mjs src/infra/state-migrations.channel-pairing.test.ts
    • 1 test file passed
    • 6 tests passed
  • git diff --check origin/release/2026.7.2...HEAD passed.
  • Patch identity matches upstream commit 5e4107400963 exactly.
  • Autoreview (--mode branch --base origin/release/2026.7.2) reported no
    accepted/actionable findings and assessed the patch as correct with 0.94
    confidence.

Verification

What was not tested

  • No live WhatsApp account or message round trip was used; the changed behavior
    is pre-channel startup migration and Gateway readiness, proven through the
    built CLI with synthetic state.
  • The preferred Blacksmith Testbox attempt was blocked because the local
    Blacksmith CLI was not authenticated. Per the trusted-source fallback rule,
    the same build/startup proof ran locally on a supported Node runtime.
  • No broad/full test suite was run for this one-commit backport.

AI-assisted backport; the source commit was already reviewed on main.

…claw#108453)

* fix: migrate legacy default channel allowlists

* docs: explain bundled-channel default-account boundary in allowFrom migration
@clawsweeper clawsweeper Bot added rating: 🦪 silver shellfish Thin PR readiness signal; proof, validation, or implementation needs work. status: 📣 needs proof The PR needs real behavior proof before ClawSweeper can clear the contributor ask. P1 High-priority user-facing bug, regression, or broken workflow. merge-risk: 🚨 compatibility 🚨 May break existing users, config, migrations, defaults, or upgrade paths. merge-risk: 🚨 availability 🚨 May cause crashes, hangs, restart loops, stalls, or process outages. labels Jul 17, 2026
@clawsweeper

clawsweeper Bot commented Jul 17, 2026 •

Copy link
Copy Markdown
Contributor

Codex review: needs maintainer review before merge. Reviewed July 17, 2026, 7:24 PM ET / 23:24 UTC.

Summary
Backports the bundled-channel default-account migration so whatsapp-default-allowFrom.json is migrated even without channels.whatsapp configuration, while external-channel filenames remain unresolved.

PR surface: Source +5, Tests +42. Total +47 across 2 files.

Reproducibility: yes. for the release-base upgrade state: the PR supplies a concrete synthetic credentials/whatsapp-default-allowFrom.json setup with no WhatsApp configuration and redacted Gateway-readiness results. Current main already contains the upstream fix, so the relevant reproduction target is the stated 2026.7.2 release base.

Review metrics: 1 noteworthy metric.

  • Legacy resolution paths: 1 bundled-only default-account path added; 2 regression cases added. The added path changes persisted upgrade migration behavior, while the paired tests preserve the external-channel non-inference boundary.

Stored data model
Persistent data-model change detected: serialized state: src/infra/state-migrations.channel-pairing.test.ts, serialized state: src/infra/state-migrations.channel-pairing.ts, unknown-data-model-change: src/infra/state-migrations.channel-pairing.test.ts. Confirm migration or upgrade compatibility proof before merge.

Root-cause cluster
Relationship: fixed_by_candidate
Canonical: #108421
Summary: This PR is the release-branch candidate for the closed legacy WhatsApp allowlist startup regression; the merged mainline implementation is the same underlying repair.

Members:

Proposal only: this assessment does not dispatch repair, suppress jobs, mutate sibling items, close, or merge anything.

Merge readiness
Overall: 🦞 diamond lobster
Proof: 🦞 diamond lobster
Patch quality: 🦞 diamond lobster
Result: ready for maintainer review.

Overall follows the weaker of proof and patch quality, so missing proof can cap an otherwise strong patch.

Risk before merge

  • [P1] This changes upgrade-time mapping of persisted legacy allowlist files into shared SQLite state; the release branch should retain the exact bundled-only condition and both positive and external-channel regression cases when landing.

Maintainer options:

  1. Land the exact backport (recommended)
    Accept the bounded upgrade-migration risk by landing the reviewed one-commit upstream backport with its positive and external-channel regression coverage intact.
  2. Pause the beta backport
    Do not land if release owners no longer want this upgrade repair in the 2026.7.2 train; the mainline fix remains available separately.

Next step before merge

  • No automated repair is indicated; the branch already carries the narrow source fix and sufficient runtime proof, leaving normal release-branch landing review.

Security
Cleared: The two-file backport changes legacy migration selection and tests only; no dependency, workflow, permission, secret, network, or supply-chain surface is added.

Review details

Best possible solution:

Land the exact upstream migration backport through the reviewed release/2026.7.2 flow, retaining the bundled-only default-account boundary and the focused upgrade regressions.

Do we have a high-confidence way to reproduce the issue?

Yes for the release-base upgrade state: the PR supplies a concrete synthetic credentials/whatsapp-default-allowFrom.json setup with no WhatsApp configuration and redacted Gateway-readiness results. Current main already contains the upstream fix, so the relevant reproduction target is the stated 2026.7.2 release base.

Is this the best way to solve the issue?

Yes. Restricting canonical default inference to bundled CHANNEL_IDS fixes the established legacy artifact without extending core migration ownership to external plugin channels.

AGENTS.md: found and applied where relevant.

Codex review notes: model internal, reasoning high; reviewed against a4287653375b.

Label changes

Label changes:

  • add proof: sufficient: Contributor real behavior proof is sufficient. The PR body contains redacted after-fix terminal evidence from a built release-base comparison: the candidate migrates the legacy file, reaches Gateway readiness, remains clean on restart, and retains the external-channel fail-closed case.
  • add rating: 🦞 diamond lobster: Overall readiness is 🦞 diamond lobster; proof is 🦞 diamond lobster and patch quality is 🦞 diamond lobster.
  • add status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR. Sufficient (logs): The PR body contains redacted after-fix terminal evidence from a built release-base comparison: the candidate migrates the legacy file, reaches Gateway readiness, remains clean on restart, and retains the external-channel fail-closed case.
  • remove rating: 🦪 silver shellfish: Current PR rating is rating: 🦞 diamond lobster, so this older rating label is no longer current.
  • remove status: 📣 needs proof: Current PR status label is status: 👀 ready for maintainer look.

Label justifications:

  • P1: Affected upgraded WhatsApp installations can fail Gateway readiness until the legacy allowlist is migrated.
  • merge-risk: 🚨 compatibility: The patch changes how an existing persisted *-default-allowFrom.json upgrade artifact maps to an account.
  • merge-risk: 🚨 availability: The affected migration runs before readiness, so an incorrect mapping could either retain the startup wedge or migrate an unintended file.
  • rating: 🦞 diamond lobster: Overall readiness is 🦞 diamond lobster; proof is 🦞 diamond lobster and patch quality is 🦞 diamond lobster.
  • status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR. Sufficient (logs): The PR body contains redacted after-fix terminal evidence from a built release-base comparison: the candidate migrates the legacy file, reaches Gateway readiness, remains clean on restart, and retains the external-channel fail-closed case.
  • proof: sufficient: Contributor real behavior proof is sufficient. The PR body contains redacted after-fix terminal evidence from a built release-base comparison: the candidate migrates the legacy file, reaches Gateway readiness, remains clean on restart, and retains the external-channel fail-closed case.
Evidence reviewed

PR surface:

Source +5, Tests +42. Total +47 across 2 files.

View PR surface stats
Area Files Added Removed Net
Source 1 5 0 +5
Tests 1 42 0 +42
Docs 0 0 0 0
Config 0 0 0 0
Generated 0 0 0 0
Other 0 0 0 0
Total 2 47 0 +47

What I checked:

  • Bundled-channel boundary: The changed parser resolves an explicit default account only when the parsed channel is in CHANNEL_IDS, preserving unresolved behavior for configured or file-discovered external channels. (src/infra/state-migrations.channel-pairing.ts:112, f8ed872d6cce)
  • Regression coverage: The branch adds a positive no-config bundled WhatsApp migration test and a negative external-channel test, covering both the repaired upgrade state and the owner-boundary guard. (src/infra/state-migrations.channel-pairing.test.ts:86, f8ed872d6cce)
  • Mainline provenance: The supplied related-item data identifies merged mainline PR 108453, merged as 5e4107400963067694d621fd2fcc47991bb98ae5, as the source implementation; this branch states it is the exact one-commit backport. (src/infra/state-migrations.channel-pairing.ts:112, 5e4107400963)
  • Real upgrade behavior proof: The PR body provides redacted terminal evidence that the release base leaves the legacy WhatsApp file unresolved and blocks readiness, while this head migrates three entries into SQLite, removes the file, reaches ready, stays clean on a second startup, and leaves an external-channel file unresolved. (f8ed872d6cce)
  • Release-branch scope: The supplied PR metadata shows a clean merge from head f8ed872d6ccee2e5c155cd16c07b14e18bf51633 into release base 95c4b78283be3c193a7cb921b2c8def3689e57b1; the source patch is already merged on current main rather than being an unreviewed new design. (f8ed872d6cce)

Likely related people:

  • smoe: The reviewed branch is described as an exact backport of the merged mainline migration fix authored by smoe. (role: introduced the upstream fix; confidence: high; commits: 5e4107400963; files: src/infra/state-migrations.channel-pairing.ts, src/infra/state-migrations.channel-pairing.test.ts)
What the crustacean ranks mean
  • 🦀 challenger crab: rare, exceptional readiness with strong proof, clean implementation, and convincing validation.
  • 🦞 diamond lobster: very strong readiness with only minor maintainer review expected.
  • 🐚 platinum hermit: good normal PR, likely mergeable with ordinary maintainer review.
  • 🦐 gold shrimp: useful signal, but proof or patch confidence is still limited.
  • 🦪 silver shellfish: thin signal; proof, validation, or implementation needs work.
  • 🧂 unranked krab: not merge-ready because proof is missing/unusable or there are serious correctness or safety concerns.
  • 🌊 off-meta tidepool: rating does not apply to this item.

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 keeps one durable marker-backed review comment per issue or PR.
  • Re-runs edit this comment so the latest verdict, findings, and automation markers stay together instead of adding duplicate bot comments.
  • A fresh review can be triggered by eligible @clawsweeper re-review comments, exact-item GitHub events, scheduled/background review runs, or manual workflow dispatch.
  • PR/issue authors and users with repository write access can comment @clawsweeper re-review or @clawsweeper re-run on an open PR or issue to request a fresh review only.
  • Maintainers can also comment @clawsweeper review to request a fresh review only.
  • Fresh-review commands do not start repair, autofix, rebase, CI repair, or automerge.
  • Maintainer-only repair and merge flows require explicit commands such as @clawsweeper autofix, @clawsweeper automerge, @clawsweeper fix ci, or @clawsweeper address review.
  • Maintainers can comment @clawsweeper explain to ask for more context, or @clawsweeper stop to stop active automation.
Review history (1 earlier review cycle)
  • reviewed 2026-07-17T22:56:36.422Z sha f8ed872 :: needs real behavior proof before merge. :: none

@VACInc

VACInc commented Jul 17, 2026

Copy link
Copy Markdown
Member Author

@clawsweeper re-review

@clawsweeper

clawsweeper Bot commented Jul 17, 2026 •

Copy link
Copy Markdown
Contributor

🦞🧹
ClawSweeper re-review requested.

I asked ClawSweeper to review this item again.
Action: item re-review queued (workflow sweep.yml, event repository_dispatch).
Result: the existing ClawSweeper review comment will be edited in place when the review finishes.

Re-review progress:

@clawsweeper clawsweeper Bot added proof: sufficient ClawSweeper judged the real behavior proof convincing. rating: 🦞 diamond lobster Very strong PR readiness with only minor maintainer review expected. status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR. and removed rating: 🦪 silver shellfish Thin PR readiness signal; proof, validation, or implementation needs work. status: 📣 needs proof The PR needs real behavior proof before ClawSweeper can clear the contributor ask. labels Jul 17, 2026
@jalehman
jalehman merged commit dc5e972 into openclaw:release/2026.7.2 Jul 17, 2026
191 of 207 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

merge-risk: 🚨 availability 🚨 May cause crashes, hangs, restart loops, stalls, or process outages. merge-risk: 🚨 compatibility 🚨 May break existing users, config, migrations, defaults, or upgrade paths. P1 High-priority user-facing bug, regression, or broken workflow. proof: sufficient ClawSweeper judged the real behavior proof convincing. rating: 🦞 diamond lobster Very strong PR readiness with only minor maintainer review expected. size: XS status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants