Skip to content

Upgrade 2026.6.8→2026.6.9 corrupts email channel config with spurious groupAllowFrom field #95515

Closed

Description

@starpig1981

Bug Report: Upgrade from 2026.6.8 → 2026.6.9 Corrupts email channel config

Description

When upgrading from OpenClaw 2026.6.8 to 2026.6.9, the upgrade process incorrectly writes a groupAllowFrom field into the channels.email.accounts.default section of openclaw.json, which is invalid for the email plugin schema. This causes the Gateway to fail to start with the following error:

Config validation failed: channels.email.accounts.default: invalid config for plugin email: must not have additional properties: "groupAllowFrom"

Steps to Reproduce

  1. Have a working OpenClaw 2026.6.8 configuration with email channel configured
  2. Trigger upgrade to 2026.6.9
  3. Observe that openclaw.json now contains an erroneous groupAllowFrom field under channels.email.accounts.default
  4. Gateway fails to start

Expected Behavior

Upgrade process should preserve the email account configuration without injecting groupAllowFrom into it. The groupAllowFrom field is valid only for Feishu channel configuration (channels.feishu.groupAllowFrom).

Evidence

Config diff (before → after upgrade):

  "feishu": { ... },
  "email": {
    "enabled": true,
    "accounts": {
      "default": {
        "enabled": true,
        "email": "wayneye@claw.163.com",
        "transport": "ws",
        "apiKey": "***",
        "allowFrom": ["*"]
+        "groupAllowFrom": ["*"]   ← incorrectly injected
      }
    }
  }

Impact

  • Gateway fails to start after upgrade
  • Email channel becomes unavailable
  • OpenClaw auto-restore mechanism eventually recovers (reverts to last-known-good), but the first start after upgrade always fails

Environment

  • macOS 26.5.1 (arm64)
  • OpenClaw 2026.6.9
  • Email plugin via ClawMail (claw.163.com)

Activity

  1. clawsweeper commented on Jun 21, 2026

    @clawsweeper
    Contributor

    Codex review: keeping this open for maintainer follow-up; there is still a little grit to resolve. Reviewed July 5, 2026, 4:56 AM ET / 08:56 UTC.

    Summary
    Keep open: current main and the latest v2026.6.11 release still have the permissive doctor migration path that can write groupAllowFrom into schemaless external channel config, and #95540 is still the open fix candidate rather than a merged implementation.

    Reproducibility: yes. for source-level reproduction: current main and v2026.6.11 still permit missing-schema writes and then assign groupAllowFrom onto records. Reporter comments add live ClawMail upgrade evidence and an independent external RCS plugin reproduction, though this review did not rerun the packaged upgrade path.

    Root-cause cluster
    Relationship: canonical
    Canonical: #95515
    Summary: This issue is the canonical report for the external-channel groupAllowFrom doctor/update corruption; one open PR is the focused fix candidate, while broader config-protection work is only partially overlapping.

    Members:

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

    Next step
    No new repair lane should be queued because #95540 is already the focused open fix candidate for this issue.

    Maintainer decision needed

    • Question: Should OpenClaw core doctor refuse groupAllowFrom writes when it cannot see a channel plugin schema, or should external plugins get an explicit opt-in migration contract first?
    • Rationale: The bug is real, but the remaining choice is the compatibility boundary for external plugin config repair during upgrade.
    • Likely owner: steipete — This account introduced and merged the fallback migration being repaired, so it is the strongest routing signal for the compatibility-boundary choice.
    • Options:
      • Land Schema-Verified Guard (recommended): Merge the narrow fail-closed guard once normal gates pass, leaving schemaless external channel config untouched by core doctor.
      • Add External Opt-In: Pause the fix and design a plugin doctor/schema capability so external channels can opt into this migration safely.
      • Use Broader Protection Only: Supersede the narrow PR only if broader config-protection work proves the same email/RCS regression behavior and coverage.
    Review details

    Best possible solution:

    Land #95540 or an equivalent schema-verified doctor guard with the external-channel regression test, then close this issue from the merged fix.

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

    Yes for source-level reproduction: current main and v2026.6.11 still permit missing-schema writes and then assign groupAllowFrom onto records. Reporter comments add live ClawMail upgrade evidence and an independent external RCS plugin reproduction, though this review did not rerun the packaged upgrade path.

    Is this the best way to solve the issue?

    Yes, the best narrow fix is the schema-verified doctor write guard in #95540 or an equivalent change at the same write decision point. The broader protected-config draft is adjacent but not yet a cleaner proven replacement for this exact regression.

    AGENTS.md: found and applied where relevant.

    Remaining risk / open question:

    • The exact packaged ClawMail upgrade path was not rerun in this read-only pass; the decision rests on current source, latest-release source, reporter live evidence, and an independent external RCS reproduction.
    • The open fix changes a released doctor migration default for schemaless external plugins, so maintainer acceptance of the fail-closed behavior is still needed before landing.

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

    Label changes

    Label changes:

    • add P0: A released update path can write invalid config and block Gateway startup, with recovery requiring manual config inspection or editing.
    • add impact:ux-release-blocker: A community user can be blocked during update recovery unless they manually find and remove the illegal config field.
    • add maturity:stable: cli-install-update-onboard-doctor is scored M4 Stable, and this issue affects its Doctor and Updates/Upgrades path.
    • add issue-rating: 🦞 diamond lobster: Current issue advisory state selects this label.
    • add clawsweeper:source-repro: Current issue advisory state selects this label.
    • add clawsweeper:linked-pr-open: Current issue advisory state selects this label.
    • remove P1: Current review triage priority is P0, so this older priority label is no longer current.
    • remove clawsweeper:needs-maintainer-review: Current issue advisory state no longer selects this label.
    • remove clawsweeper:needs-live-repro: Current issue advisory state no longer selects this label.
    • remove impact:message-loss: Current review impact labels are impact:data-loss, impact:crash-loop, impact:ux-release-blocker.
    • remove issue-rating: 🐚 platinum hermit: Current issue advisory state no longer selects this label.

    Label justifications:

    • P0: A released update path can write invalid config and block Gateway startup, with recovery requiring manual config inspection or editing.
    • impact:data-loss: The report is about doctor/update repair corrupting persisted openclaw.json channel config.
    • impact:crash-loop: The invalid plugin config causes Gateway startup validation to fail after upgrade.
    • impact:ux-release-blocker: A community user can be blocked during update recovery unless they manually find and remove the illegal config field.
    • maturity:stable: cli-install-update-onboard-doctor is scored M4 Stable, and this issue affects its Doctor and Updates/Upgrades path.
    Evidence reviewed

    What I checked:

    Likely related people:

    • steipete: Authored and merged the PR that added the doctor group allowFrom fallback migration, its tests, and repair-sequencing integration. (role: introduced behavior; confidence: high; commits: cce12697a1ee; files: src/commands/doctor/shared/allowfrom-fallback-migration.ts, src/commands/doctor/shared/allowfrom-fallback-migration.test.ts, src/commands/doctor/repair-sequencing.ts)
    • vincentkoc: Added the generated-schema write guard that still permits missing schemas and has recent adjacent doctor/channel capability work plus broader config-protection work. (role: recent area contributor; confidence: high; commits: 9aa9c57625fc, 5b79fa13e285, 66e06b50bac3; files: src/commands/doctor/shared/allowfrom-fallback-migration.ts, src/commands/doctor/channel-capabilities.ts, src/config)
    • ZengWen-DT: Authored the current open narrow fix PR for this issue with regression coverage for schemaless external channels. (role: candidate fix contributor; confidence: medium; commits: f497bf398c29; files: src/commands/doctor/shared/allowfrom-fallback-migration.ts, src/commands/doctor/shared/allowfrom-fallback-migration.test.ts)
    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.
  2. added
    P1High-priority user-facing bug, regression, or broken workflow.
    impact:data-lossCan lose, corrupt, or silently drop user/session/config data.
    impact:crash-loopCrash, hang, restart loop, or process-level availability failure.
    impact:message-lossChannel message delivery can be lost, duplicated, or misrouted.
    issue-rating: 🐚 platinum hermitGood issue quality with a plausible reproduction path needing some confirmation.
    clawsweeper:needs-live-reproClawSweeper needs live local, crabbox, or manual validation to confirm this issue.
    clawsweeper:no-new-fix-prClawSweeper does not recommend queueing a new automated fix PR for this issue.
    clawsweeper:needs-maintainer-reviewClawSweeper marked this issue as needing maintainer review before automation.
    on Jun 21, 2026
  3. starpig1981 commented on Jun 24, 2026

    @starpig1981
    Author

    Bug still reproduces on 2026.6.10 upgrade — providing live evidence

    I just hit this again trying to upgrade from 2026.6.9 → 2026.6.10. The fix has not landed.

    Timeline (today, 2026-06-24 ~20:23 local Asia/Shanghai)

    • openclaw update triggered upgrade to 2026.6.10
    • Upgrade script modified ~/.openclaw/openclaw.json
    • New gateway process failed schema validation, gateway auto-rolled back to openclaw.json.last-good
    • Result: still on 2026.6.9, upgrade effectively blocked

    File-level evidence on disk

    Three files preserved from this run:

    1. openclaw.json.pre-update (state right before upgrade, valid):

    199:      "groupAllowFrom": [       ← only Feishu channel
    

    2. openclaw.json.clobbered.2026-06-24T12-23-14-668Z (what upgrade script wrote, INVALID):

    199:      "groupAllowFrom": [       ← Feishu
    214:          "groupAllowFrom": [   ← ALSO inside channels.email.accounts.default ← BUG
    

    3. openclaw.json (current / last-good after auto-rollback):

    199:      "groupAllowFrom": [       ← only Feishu, healthy
    

    So the doctor migration copied channels.feishu.groupAllowFrom into channels.email.accounts.default.* during the upgrade. The Feishu value stayed where it should be; the email account got an extra illegal copy.

    Why the email account rejects it

    Per config.schema.lookup channels.email.accounts.default:

    { "type": "object", "additionalProperties": false }

    Plus ghp_… account schemas do not declare groupAllowFrom. So the schema-validate-on-startup guard fires and gateway refuses to boot.

    Confirmation this is the same doctor migration bug

    • Same field (groupAllowFrom)
    • Same wrong destination (email.accounts.default.*)
    • Same recovery mechanism (gateway last-known-good rollback)
    • Happens on every upgrade (6.8→6.9 confirmed earlier, 6.9→6.10 confirmed today)

    Repro recipe for maintainers

    # Setup
    openclaw config set channels.feishu.groupAllowFrom '["chat_xxx"]'
    # Verify schema-valid baseline
    openclaw gateway restart   # green
    
    # Trigger
    openclaw update            # tries 6.9 → 6.10
    
    # Observe
    diff openclaw.json.pre-update openclaw.json.clobbered.* | grep groupAllowFrom
    # → shows groupAllowFrom was injected under channels.email.accounts.default

    Suggested direction (informational, not a PR)

    The narrow guard from #95518 looked right to me as a user — refusing doctor writes to fields not present in the bundled schema for that account type. Happy to test a new build if maintainers want a live confirmation run before merging.

  4. starpig1981 commented on Jun 24, 2026

    @starpig1981
    Author

    Followup #2: Historical pattern from config-audit.jsonl

    I dug into ~/.openclaw/logs/config-audit.jsonl and found the same bug has fired at least 4 times, not just on 6.10. Every occurrence has identical fingerprint: cwd=/opt/homebrew/lib/node_modules/openclaw, argv=doctor --non-interactive --fix, config grows by ~59 bytes (exactly one groupAllowFrom array injected under channels.email.accounts.<acc>).

    Pattern from audit log

    Timestamp (UTC) Trigger Before → After Δ Auto-rolled-back?
    2026-06-10 03:42:03 doctor --non-interactive --fix (cwd node_modules/openclaw) 3935 → 5293 +1358 No (this one also touched other things)
    2026-06-13 06:02:57 same 6550 → 6603 +53 No (gateway started anyway)
    2026-06-19 02:50:00 same 6761 → 6814 +53 No
    2026-06-21 07:51:33 same 7261 → 7320 +59 Yes (clobbered + last-good restored)
    2026-06-24 12:19:44 same 7259 → 7318 +59 Yes (clobbered + last-good restored)

    All five events: argv starts with node /opt/homebrew/lib/node_modules/openclaw/dist/index.js, cwd is the package install dir. None of the user-driven writes (e.g. openclaw config patch, openclaw plugins install, openclaw hooks enable) ever produce this diff.

    Two argv variants observed

    • Doctor as upgrader: doctor --non-interactive --fix, cwd node_modules/openclaw — the buggy path.
    • Doctor as recoverer: doctor --fix, cwd /Users/wayne — runs the schema validator and triggers last-good restore when invalid.

    The first is invoked by the update flow (right before update --json --yes on the same pid chain). It writes a mutated config and lets the gateway boot detect the corruption.

    Why the "auto-rollback" only fires sometimes

    Looking at config-health.json, gateway only rolls back when it actually re-reads the config and finds it invalid against the live schema. The 6.10 and 6.21 events triggered it because they were followed by an immediate gateway restart or by a doctor --fix (cwd home) which runs the validator before next boot. The earlier ones (6.10/6.13/6.19) didn't roll back — but they also injected the bad field, it just wasn't caught until something else triggered a re-read.

    So additionalProperties: false has likely been in place since at least 6.10; the doctor migration has been wrong for the same time. It's just that nobody re-read the schema against the email account between those events.

    One more thing: gateway uptime is fine, the user is unaffected

    The last-known-good fallback saved us every time. Config health file shows the current lastKnownGood hash afde000e… is the post-6.9 clean state (7259 bytes), gateway is healthy on 2026.6.9. We just can't get past doctor --fix during upgrade.

    Suggested next steps (still informational)

    1. Fix the doctor writeback to skip fields that aren't in the bundled schema for the target channel account type. This is the conservative guard from fix(doctor): prevent writing groupAllowFrom to external channel plugins without schema #95518 — it'd block the entire class.
    2. As a stopgap for users: detect cwd=node_modules/openclaw and refuse to write to channels.email.accounts.*.groupAllowFrom (or any field not declared in the per-account schema).
    3. Consider a post-doctor schema validation step inside the upgrade flow before the gateway restart — this would turn the silent corruption into a hard error at upgrade time instead of being caught (or missed) by whatever happens to re-read the config next.

    Happy to run any of these against a test build if maintainers want a live confirmation.

  5. starpig1981 commented on Jun 24, 2026

    @starpig1981
    Author

    Followup #3: 6.10 upgrade confirms bug still fires — and last-known-good fallback isn't bulletproof

    Upgraded to 2026.6.10 (aa69b12) today and got clean confirmation the doctor migration bug still injects groupAllowFrom into channels.email.accounts.default. But I owe you a correction on my last comment: the gateway's automatic rollback did NOT save me this time. I manually removed the illegal field between the bad write and the next gateway boot.

    Audit log (corrected reading)

    UTC time Event cwd bytes hash
    12:36:46 gateway start post-upgrade /Users/wayne/.openclaw 7259 → 7257 afde000e → 858e3238
    12:39:03 doctor --non-interactive --fix /opt/homebrew/lib/node_modules/openclaw 7257 → 7318 858e3238 → 224c0230 ⚠️ bug injected
    (manual) user removed groupAllowFrom from email account — 7318 → 7259 224c0230 → (clean)
    12:42:56 gateway restart /Users/wayne/.openclaw (clean) 2164a3dd

    The previous comment claimed gateway auto-rolled-back to last-good. That was wrong — config-health.json shows the new lastKnownGood hash 2164a3dd… matches the post-manual-fix hash, not the prior last-good afde000e…. So this run actually relied on the user noticing and patching the config before the gateway restart could detect and react.

    Implication for fallback reliability

    Looking back at the 5 historical events:

    • 2026-06-10, 06-13, 06-19: injected bad field, no rollback, no failure — gateway kept running with the illegal field because it never re-validated against current schema on those versions
    • 2026-06-21, 06-24: rolled back via the doctor-driven observe → restore path — only because a second doctor --fix from a non-upgrade cwd happened to run and caught the corruption
    • 2026-06-24 (just now): did NOT auto-rollback — user had to manually delete the field

    So the last-known-good mechanism is reactive, not proactive. It only kicks in when something forces a re-validate at exactly the right moment. If the user (or some other automation) doesn't trigger a re-read, the bad config sits there silently.

    This actually makes the doctor writeback bug more dangerous than my earlier analysis suggested — it can persist across many restarts on older versions, and even on 6.10 it depends on timing.

    Concrete fix proposal (revised)

    The conservative guard from #95518 (skip writes for fields not in the target schema) remains the right primary fix. But I'd add:

    1. Pre-write schema check inside doctor --fix: before renaming the new config, validate it against the per-account-type schema. If it fails, refuse to write and report.
    2. Post-write self-check in the update flow: right after the upgrade doctor run, the upgrade script itself should doctor --validate (no fix) and abort the upgrade with a clear error if the resulting config is invalid. This turns the silent corruption into a loud failure at the exact point it's introduced.
    3. cwd-aware write guard as a defense in depth: if cwd is node_modules/openclaw (i.e. upgrade-context), refuse to write to any channels.*.accounts.* field that isn't in the bundled per-account schema.

    Option 2 is probably the smallest delta that would have prevented today's event — and it would have surfaced the bug as a clear upgrade failure instead of leaving the user to debug why their gateway won't start.

    Status

    • ✅ Upgraded to 2026.6.10
    • ✅ Config clean
    • ✅ Gateway running
    • ❌ Bug still present in 2026.6.10
    • ❌ No upstream fix yet

    Local workaround: pre-validate config before upgrade (openclaw config validate), and after upgrade manually verify no illegal fields under channels.email.accounts.*. Documenting in case other users hit this.

  6. clawSean commented on Jul 4, 2026

    @clawSean
    Contributor

    Independent reproduction with a different external channel plugin — this is not specific to the ClawMail email plugin.

    Setup: locally-developed external RCS channel plugin in ~/.openclaw/extensions/rcs/, strict config schema (additionalProperties: false), channels.rcs.allowFrom populated.

    Trigger: openclaw update. Result:

    Config validation failed: channels.rcs: invalid config for plugin rcs: must not have additional properties: "groupAllowFrom"
    

    The repair copied channels.rcs.allowFrom → channels.rcs.groupAllowFrom, then validation against the plugin's own schema rejected the key it had just written, and the Gateway failed to start.

    Root cause confirmed in source (src/commands/doctor/shared/allowfrom-fallback-migration.ts + src/commands/doctor/channel-capabilities.ts) — two permissive defaults compound for external plugins, because the repair runs before external plugins are loaded into the registry:

    1. getDoctorChannelCapabilities() finds no bundled manifest metadata and no registered plugin, so it falls back to DEFAULT_DOCTOR_CHANNEL_CAPABILITIES with groupAllowFromFallbackToAllowFrom: true.
    2. generatedSchemaAllowsGroupAllowFrom() returns !schema || schemaAllowsConfigPath(...) — a channel absent from GENERATED_BUNDLED_CHANNEL_CONFIG_METADATA (i.e., every external plugin) has no schema there, so the write is allowed by default.

    So doctor writes a key into a config section whose schema it cannot see, and any external channel plugin with a strict schema crashes on the next update. Trying to declare doctorCapabilities.groupAllowFromFallbackToAllowFrom: false in the plugin doesn't help — the repair runs before the plugin loads, so core never sees it. The only plugin-side workaround is absorbing the field (accepting groupAllowFrom in the plugin schema), which shouldn't be necessary.

    The conservative-by-default approach in #95540 (skip the migration when core has no schema for the channel) matches exactly what we'd have proposed. +1 on landing that.

  7. added
    P0Emergency: data loss, security bypass, crash loop, or unusable core runtime.
    impact:ux-release-blockerA non-technical user is blocked without terminal, logs, config, or support.
    maturity:stableBroken existing behavior primarily owned by an M4/M5 scorecard surface.
    issue-rating: 🦞 diamond lobsterVery strong issue quality with high-confidence source-level or clear reproduction.
    clawsweeper:source-reproClawSweeper found a high-confidence source-level issue reproduction.
    clawsweeper:linked-pr-openClawSweeper found an open linked pull request for this issue.
    and removed
    P1High-priority user-facing bug, regression, or broken workflow.
    impact:message-lossChannel message delivery can be lost, duplicated, or misrouted.
    clawsweeper:needs-maintainer-reviewClawSweeper marked this issue as needing maintainer review before automation.
    clawsweeper:needs-live-reproClawSweeper needs live local, crabbox, or manual validation to confirm this issue.
    issue-rating: 🐚 platinum hermitGood issue quality with a plausible reproduction path needing some confirmation.
    on Jul 5, 2026
  8. clawSean commented on Jul 25, 2026

    @clawSean
    Contributor

    A current-main revival of ZengWen-DT's fix from #95540 is now available in #113863.

    The original patch and focused regression test are preserved with ZengWen-DT as the commit author. Exact current main still reproduced the permissive missing-schema write, while both prior narrow fixes were closed unmerged.

    Fresh validation on the replacement head: focused test 7/7, oxfmt clean, oxlint clean, git diff --check clean, plus before/after helper output showing the external channel remains untouched while the bundled-channel migration still runs.

  9. obviyus commented on Jul 30, 2026

    @obviyus
    Collaborator

    Fixed on main by edbb1fc (#116025).

    The doctor groupAllowFrom fallback now fails closed when a channel has no generated schema metadata, which is exactly the case for extension-installed channels like ClawMail/agentmail (src/commands/doctor/shared/allowfrom-fallback-migration.ts:108-112):

    // Extension-installed channels (e.g. ClawHub agentmail) have no generated-metadata entry;
    // without schema info we can't prove the write is safe, so fail closed rather than open.
    return schema !== undefined && schemaAllowsConfigPath(schema, path);

    That guard gates the write at :179, so upgrade/doctor can no longer inject groupAllowFrom into an email account config and trip the plugin's schema validation on startup.

    If your config was already corrupted by an earlier run, remove the spurious groupAllowFrom key once and re-run openclaw doctor — the key will not come back.

    Closing as fixed. Thanks for the precise report; the "doctor writes a field the plugin schema rejects" class was worth fixing generically rather than per-channel.

  10. locked as resolved and limited conversation to collaborators on Oct 10, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    P0Emergency: data loss, security bypass, crash loop, or unusable core runtime.clawsweeper:linked-pr-openClawSweeper found an open linked pull request for this issue.clawsweeper:no-new-fix-prClawSweeper does not recommend queueing a new automated fix PR for this issue.clawsweeper:source-reproClawSweeper found a high-confidence source-level issue reproduction.impact:crash-loopCrash, hang, restart loop, or process-level availability failure.impact:data-lossCan lose, corrupt, or silently drop user/session/config data.impact:ux-release-blockerA non-technical user is blocked without terminal, logs, config, or support.issue-rating: 🦞 diamond lobsterVery strong issue quality with high-confidence source-level or clear reproduction.maturity:stableBroken existing behavior primarily owned by an M4/M5 scorecard surface.

    Type

    No type

    Fields

    Priority

    None yet

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions