Skip to content

fix: gateway startup fails on legacy default channel allowlists - #108453

Merged
jalehman merged 2 commits into
openclaw:mainfrom
smoe:codex/fix-legacy-default-allowfrom-migration
Jul 17, 2026
Merged

jalehman merged 2 commits into
openclaw:mainfrom
smoe:codex/fix-legacy-default-allowfrom-migration

Conversation

@smoe

@smoe smoe commented Jul 15, 2026

Copy link
Copy Markdown
Contributor

Fixes #108421
Related to #108299

What Problem This Solves

Fixes an issue where users upgrading from OpenClaw 2026.7.1 to
2026.7.2-beta.1 could no longer start the Gateway when a legacy
credentials/whatsapp-default-allowFrom.json file remained and no
channels.whatsapp section existed.

The startup migration reported the legacy file as unresolved and left it in
place. openclaw doctor --fix detected the same warning but could not complete
the migration, so Gateway startup continued to refuse readiness.

Why This Change Was Made

Legacy scoped allowFrom filenames are parsed as a channel ID plus an account
key. The migration already knows whatsapp is a bundled channel through
CHANNEL_IDS, but it previously accepted the default account suffix only
when that account had also been discovered from channel configuration or
bindings. With no channels.whatsapp section, the explicit default suffix
therefore had no configured match and was classified as unresolved.

The parser now recognizes an explicit default suffix as the canonical default
account when, and only when, the parsed channel is a bundled OpenClaw channel.
The existing migration then imports the allowlist into the shared SQLite pairing
state and removes the legacy JSON file.

This is intentionally narrower than adding default to every discovered
channel:

  • External plugin channels still require an explicit configured account match.
  • Sanitized account-name collisions remain ambiguous.
  • Filenames with overlapping channel/account interpretations remain ambiguous.
  • No Doctor orchestration, startup readiness, configuration, SQLite schema, or
    plugin migration behavior changes.

Special-casing WhatsApp was also considered, but rejected because default is
the canonical account ID across bundled channels. Restricting the general rule
to CHANNEL_IDS preserves the core/plugin ownership boundary without adding a
channel-specific exception.

User Impact

Affected upgrades can automatically migrate
whatsapp-default-allowFrom.json into the SQLite pairing state under the
default account. The legacy file is removed after a successful import, so
startup migrations complete without requiring users to recreate channel
configuration or manually relocate the file.

Evidence

The positive regression test creates the reported version-1 object shape with:

  • bundled channel whatsapp;
  • no channels.whatsapp configuration;
  • an explicit default account suffix;
  • properly formatted fictional E.164 allowlist entries.

It verifies that:

  • no unresolved warning is emitted;
  • all entries are stored in SQLite under whatsapp/default;
  • the migration reports success; and
  • the legacy source file is removed.

A negative regression test creates
custom-channel-default-allowFrom.json for an external configured channel with
no configured account. It verifies that the migration remains unresolved,
leaves the source file in place, and writes no SQLite allowlist.

Executed locally:

  • node scripts/run-vitest.mjs src/infra/state-migrations.channel-pairing.test.ts
    — 6 tests passed;
  • targeted oxlint for both changed files;
  • pnpm format for both changed files; and
  • git diff --check.

The full changed TypeScript/lint fan-out is left to PR CI because the configured
Blacksmith Testbox tooling is unavailable on this host.

AI-assisted: implemented and manually reviewed with Codex. No agent transcript
is attached.

@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: 🚨 security-boundary 🚨 May affect sandboxing, authorization, credentials, or sensitive data. labels Jul 16, 2026
@clawsweeper

clawsweeper Bot commented Jul 16, 2026 •

Copy link
Copy Markdown
Contributor

Codex review: needs maintainer review before merge. Reviewed July 17, 2026, 5:58 PM ET / 21:58 UTC.

Summary
The PR treats an explicit default suffix in legacy bundled-channel allowlist filenames as the canonical default account without channel configuration, with positive bundled-channel and negative external-channel regression tests.

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

Reproducibility: yes. at source level: a version-1 whatsapp-default-allowFrom.json file with no configured WhatsApp account follows the unresolved parser path described by the linked report, and the branch’s regression fixture encodes that exact state. The contributor also supplied redacted after-fix runtime output from a temporary-state run.

Review metrics: 1 noteworthy metric.

  • Legacy access-control fallback: 1 added fallback. The new fallback changes upgrade-time ownership of persisted allowlist entries only for bundled channels with an explicit default suffix and no configured account match.

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 candidate fix for the specific unresolved WhatsApp default-account migration; the broader upgrade report includes additional distinct claims.

Members:

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

Merge readiness
Overall: 🐚 platinum hermit
Proof: 🐚 platinum hermit
Patch quality: 🐚 platinum hermit
Result: ready for maintainer review.

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

Rank-up moves:

  • [P2] Rebase or refresh the merge result against current main and rerun the focused migration coverage before merge.

Risk before merge

  • [P1] The branch is behind current main; refresh the merge result and rerun the focused migration coverage before landing so the persisted allowlist interpretation remains valid against the latest migration machinery.
  • [P1] This intentionally changes which bundled-channel account receives legacy access-control entries when configuration is absent; the external-channel regression test reduces that risk, but the upgrade behavior remains compatibility- and authorization-sensitive.

Maintainer options:

  1. Refresh the current-main merge result (recommended)
    Rebase or otherwise refresh this cleanly mergeable branch against current main, then retain the focused migration tests and the documented real runtime proof before merge.
  2. Accept the bounded migration scope
    Merge after maintainer review while accepting that every bundled <channel>-default legacy allowlist is assigned to the canonical default account when no configured account matches.

Next step before merge

  • No mechanical repair is indicated; the remaining action is normal maintainer review of a current-main refresh before merge.

Security
Cleared: The diff is limited to internal legacy-state parsing and tests, preserves ambiguity and external-channel safeguards, and adds no dependencies, secret exposure, permission broadening, downloads, or supply-chain execution.

Review details

Best possible solution:

Land the bounded parser fallback after rebasing onto current main and confirming the focused positive and external-channel-negative migration behavior still holds, while preserving collision handling and the no-inference rule for external plugins.

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

Yes at source level: a version-1 whatsapp-default-allowFrom.json file with no configured WhatsApp account follows the unresolved parser path described by the linked report, and the branch’s regression fixture encodes that exact state. The contributor also supplied redacted after-fix runtime output from a temporary-state run.

Is this the best way to solve the issue?

Yes. Resolving only the explicit canonical suffix in the existing filename parser, restricted to bundled channel IDs and after normal account matching fails, is narrower than a WhatsApp special case or default-account inference for external plugins.

AGENTS.md: unclear because the file could not be read completely.

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

Label changes

Label changes:

  • add proof: sufficient: Contributor real behavior proof is sufficient. The contributor posted redacted after-fix runtime logs from a temporary-state branch run showing the migration, intended SQLite state, legacy-file removal, and successful Gateway readiness; no private values were included.
  • add rating: 🐚 platinum hermit: Overall readiness is 🐚 platinum hermit; proof is 🐚 platinum hermit and patch quality is 🐚 platinum hermit.
  • add status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR. Sufficient (logs): The contributor posted redacted after-fix runtime logs from a temporary-state branch run showing the migration, intended SQLite state, legacy-file removal, and successful Gateway readiness; no private values were included.
  • remove rating: 🦪 silver shellfish: Current PR rating is rating: 🐚 platinum hermit, 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: The linked regression can prevent affected upgraded installations from reporting Gateway readiness until users manually repair configuration and legacy state.
  • merge-risk: 🚨 compatibility: The change alters upgrade-time interpretation and deletion of legacy persisted allowlist files when current channel configuration is absent.
  • merge-risk: 🚨 security-boundary: The migrated data is an access allowlist, and the new fallback determines the account to which those permissions are assigned.
  • rating: 🐚 platinum hermit: Overall readiness is 🐚 platinum hermit; proof is 🐚 platinum hermit and patch quality is 🐚 platinum hermit.
  • status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR. Sufficient (logs): The contributor posted redacted after-fix runtime logs from a temporary-state branch run showing the migration, intended SQLite state, legacy-file removal, and successful Gateway readiness; no private values were included.
  • proof: sufficient: Contributor real behavior proof is sufficient. The contributor posted redacted after-fix runtime logs from a temporary-state branch run showing the migration, intended SQLite state, legacy-file removal, and successful Gateway readiness; no private values were included.
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:

  • Narrow parser change: The branch adds a fallback only after no configured account match, only for the exact canonical default account ID, and only for bundled CHANNEL_IDS; existing collision and multi-target ambiguity handling remains outside that branch. (src/infra/state-migrations.channel-pairing.ts:115, 430fc0f7e375)
  • Bundled-channel regression coverage: The added WhatsApp fixture has no configured channel account and verifies successful SQLite import under whatsapp/default, no warnings, and source-file deletion. (src/infra/state-migrations.channel-pairing.test.ts:86, 430fc0f7e375)
  • External-channel boundary coverage: The added external-channel case verifies that an unconfigured default account remains unresolved, writes no SQLite allowlist, and retains the legacy file. (src/infra/state-migrations.channel-pairing.test.ts:183, 430fc0f7e375)
  • After-fix behavior proof: The contributor’s July 17, 2026 PR comment reports a temporary-state run of the branch that logged migration of whatsapp/default entries, Gateway readiness, the intended SQLite row, and no remaining legacy allowlist file. (430fc0f7e375)
  • Related-behavior provenance: The prior legacy pairing migration established default-account-only handling as the closest access-scope precedent; its history was previously traced to commits 1d4261e and d8c68c8, with jacobtomlinson recorded as merger/reviewer. (src/infra/state-migrations.ts, d8c68c8)

Likely related people:

  • pgondhi987: Authored the earlier default-account-only legacy pairing migration that supplies the closest access-control precedent for this parser boundary. (role: introduced related behavior; confidence: high; commits: 1d4261e, d8c68c8; files: src/infra/state-migrations.ts)
  • jacobtomlinson: Merged and reviewed the earlier legacy pairing migration, making them a useful routing candidate for upgrade and access-boundary review. (role: merger and reviewer of related behavior; confidence: medium; commits: d8c68c8; files: src/infra/state-migrations.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-16T04:16:59.465Z sha 430fc0f :: needs real behavior proof before merge. :: none

@smoe

smoe commented Jul 17, 2026

Copy link
Copy Markdown
Contributor Author

I cross-checked with my OpenClaw installation about what proof we may still have, other than the original bug report. This was the answer:


Adding redacted runtime proof for the migration path requested by ClawSweeper.

#108421 documents the real beta.1 failure case: an upgrade encountered a legacy bundled-channel allowlist file named whatsapp-default-allowFrom.json with this shape:

{
  "version": 1,
  "allowFrom": [
    "",
    "",
    ""
  ]
}

That is the before-fix evidence: beta.1 did not resolve that legacy whatsapp/default allowlist cleanly, and Doctor/Gateway readiness was blocked.

For after-fix evidence, I ran this PR branch in a temporary OpenClaw state directory rather than against the live gateway state:

branch: pr-108453
commit: 430fc0f7e37
state: temporary /tmp/openclaw-pr108453-proof2... directory

Relevant redacted runtime log:

[state-migrations] Auto-migrated legacy state:
- Migrated 2 whatsapp/default allowFrom entries -> shared SQLite state

[gateway] gateway ready

I also verified the resulting temporary SQLite state contains the migrated allowlist under the intended bundled channel/default account boundary:

channel_key account_id entries
whatsapp default 2

And no allowFrom.json legacy file remained in that temporary proof state after the migration.

This after-fix run is deliberately described as a temporary-state proof harness, not as the original live beta.1 upgrade state. The original real-world failing input is documented in #108421; the PR-branch proof run demonstrates that the patched migration path imports whatsapp/default allowFrom into shared SQLite state and reaches Gateway readiness afterward. Private sender values are redacted.

@jalehman
jalehman marked this pull request as ready for review July 17, 2026 21:54
@jalehman jalehman self-assigned this Jul 17, 2026
@clawsweeper clawsweeper Bot added proof: sufficient ClawSweeper judged the real behavior proof convincing. rating: 🐚 platinum hermit Good normal PR readiness with ordinary 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 5e41074 into openclaw:main Jul 17, 2026
240 of 255 checks passed
@jalehman

Copy link
Copy Markdown
Contributor

Merged via squash.

jalehman pushed a commit that referenced this pull request Jul 17, 2026
) (#110217)

* fix: migrate legacy default channel allowlists

* docs: explain bundled-channel default-account boundary in allowFrom migration

Co-authored-by: Steffen Möller <[email protected]>
github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Jul 18, 2026
…claw#108453)

* fix: migrate legacy default channel allowlists

* docs: explain bundled-channel default-account boundary in allowFrom migration
@smoe
smoe deleted the codex/fix-legacy-default-allowfrom-migration branch July 19, 2026 10:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

merge-risk: 🚨 compatibility 🚨 May break existing users, config, migrations, defaults, or upgrade paths. merge-risk: 🚨 security-boundary 🚨 May affect sandboxing, authorization, credentials, or sensitive data. P1 High-priority user-facing bug, regression, or broken workflow. proof: sufficient ClawSweeper judged the real behavior proof convincing. rating: 🐚 platinum hermit Good normal PR readiness with ordinary 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.

[Bug] doctor --fix does not migrate legacy whatsapp-default-allowFrom.json, preventing gateway startup after upgrade to 2026.7.2-beta.1

2 participants