Skip to content

[5.2] Upgrade path broken for users with externalized plugins in config: install location mismatch, doctor --fix unreachable, downgrade blocked by meta.lastTouchedVersion #76586

Closed

Description

@jackiedepp

Summary

Attempting to upgrade an active openclaw 2026.4.29 installation to 2026.5.2 fails for any user whose openclaw.json references plugins that 5.2 has externalized to separate npm packages (in our case: brave, discord, voice-call). The failure is multi-stage and the recovery path has its own blockers, leaving the gateway in a state that cannot self-recover and cannot be downgraded cleanly.

This isn't about any single externalized plugin breaking — it's that the upgrade path itself does not work end-to-end for the documented "common" case.

We worked around it manually (npm install -g @openclaw/... then cp -r into ~/.openclaw/npm/node_modules/), but that's not a procedure most users will figure out, and it leaves the install in a state that future openclaw plugins update will likely fight with.

Setup

  • Linode VPS, Singapore region
  • Pre-upgrade: openclaw 2026.4.29 (a448042), bundled brave, discord, voice-call working
  • openclaw.json references those plugins via plugins.entries.*, plugins.allow, and tools.web.search.provider: "brave"
  • ChatGPT OAuth via openai-codex/gpt-5.5, no OpenAI API key

What broke

1. Brave plugin npm package name doesn't follow the convention

The other externalized plugins follow @openclaw/<plugin-id> (@openclaw/discord, @openclaw/voice-call, @openclaw/codex, @openclaw/whatsapp). Brave is the odd one out: it's published as @openclaw/brave-plugin. The README under "Plugin externalization" doesn't call this out. We spent ~30 minutes verifying this wasn't a publish-lag issue (every other variant — @openclaw/brave, openclaw-brave, openclaw-plugin-brave — returns 404).

Suggestion: rename to @openclaw/brave (consistent), or document the suffix prominently in the externalization release notes.

2. npm install -g @openclaw/<plugin> installs to the wrong location

Running npm install -g @openclaw/brave-plugin@2026.5.2 puts the package at /home/ubuntu/.npm-global/lib/node_modules/@openclaw/brave-plugin/ — which is the standard global npm location.

Openclaw 5.2 instead looks for externalized plugins at /home/ubuntu/.openclaw/npm/node_modules/@openclaw/<plugin>/. The installs.json records this path:

"brave": {
  "source": "npm",
  "spec": "@openclaw/brave-plugin",
  "installPath": "/home/ubuntu/.openclaw/npm/node_modules/@openclaw/brave-plugin",
  "version": "2026.5.2"
}

So npm install -g registers the package as installed (it shows up via npm ls -g) but openclaw cannot find it. The user gets:

Config invalid
File: ~/.openclaw/openclaw.json
Problem:
  - tools.web.search.provider: web_search provider is not available: brave
    (install or enable plugin "brave", then run openclaw doctor --fix)

Suggestion: either (a) recognize npm-global locations as a valid plugin source, or (b) document ~/.openclaw/npm/ as the only correct install location and provide a CLI helper that does the install correctly without needing to npm install -g first.

3. openclaw plugins install is unreachable when the gateway can't boot

This is a chicken-and-egg loop:

  • Gateway can't boot because config validation fails (plugin missing)
  • openclaw plugins install @openclaw/brave-plugin requires the gateway to be reachable to register the install
  • Without the install, gateway can't boot
  • Loop forever

Even from the CLI on a stopped gateway, openclaw plugins install errors out with the same config-invalid message before reaching the install logic:

$ openclaw plugins install @openclaw/brave-plugin
... (config warnings) ...
Config invalid
File: ~/.openclaw/openclaw.json
Problem:
  - tools.web.search.provider: ...
Run: openclaw doctor --fix

Suggestion: openclaw plugins install should be runnable in a config-bypass mode for exactly this recovery scenario. Or the install should be possible from the CLI without requiring config validation to pass.

4. openclaw doctor --fix plugin auto-install never runs in this state

The 2026.5.2 release notes promise that doctor will repair missing externalized plugin installs:

"install actively used downloadable OpenClaw plugins through the configured external source"

In practice, the migration is gated on meta.lastTouchedVersion and runs as part of the gateway boot sequence. When the gateway can't boot (because of step 3), the migration never executes. We verified this by running openclaw doctor --fix --non-interactive — it errors out with the same config-invalid message before reaching the plugin-install repair step.

Suggestion: extract the plugin-install repair into a standalone command (e.g. openclaw plugins repair-installs) that runs without gateway/config dependencies.

5. Downgrade is blocked by meta.lastTouchedVersion

After the failed upgrade, downgrading to 4.29 (npm install -g openclaw@2026.4.29) gets:

Config was last written by a newer OpenClaw (2026.5.2); current version is 2026.4.29.
Refusing to start the gateway service because this OpenClaw binary (2026.4.29) is
older than the config last written by OpenClaw 2026.5.2.
Run the newer openclaw binary on PATH, or reinstall the intended gateway service from the newer install.
Set OPENCLAW_ALLOW_OLDER_BINARY_DESTRUCTIVE_ACTIONS=1 only for an intentional downgrade or recovery action.

The protection is reasonable but the failure mode is harsh: a user who hits the upgrade chain in steps 1-4 above and tries to recover by downgrading discovers they need to either (a) set an undocumented env var with a scary name, or (b) manually edit meta.lastTouchedVersion in the config back to the older version (which is what we ended up doing).

Suggestion: when OPENCLAW_ALLOW_OLDER_BINARY_DESTRUCTIVE_ACTIONS is required for a downgrade-after-failed-upgrade scenario, the error message should mention that the safe alternative is to revert meta.lastTouchedVersion in the config, with the exact key path and value to restore.

What we did to recover

  1. npm install -g openclaw@2026.5.2 (succeeded; binary in place)
  2. openclaw update --yes — failed at doctor step (steps 3, 4 above)
  3. npm install -g @openclaw/brave-plugin@2026.5.2 @openclaw/discord@2026.5.2 @openclaw/voice-call@2026.5.2 — installed packages but in wrong location (step 2)
  4. cp -r /home/ubuntu/.npm-global/lib/node_modules/@openclaw/brave-plugin /home/ubuntu/.openclaw/npm/node_modules/@openclaw/ (and same for discord, voice-call) — manual workaround for step 2
  5. systemctl --user restart openclaw-gateway.service — gateway came up, plugins now registered as enabled=True, status=loaded, version=2026.5.2
  6. After hitting a separate Telegram-polling regression (5.2 telegram polling never starts on high-RTT hosts (regression vs 4.29) #76388), we downgraded back to 4.29 — hit step 5, had to edit meta.lastTouchedVersion manually to recover

Why this matters

The 5.2 release notes pitch external plugins as the path forward, and the changelog explicitly enumerates plugins prepared for npm publishing. But for any existing installation that uses those plugins (which is the vast majority — discord, voice-call, brave, whatsapp, codex are all in the externalized set), the upgrade path described in the changelog does not work without the manual workarounds above. Most users will get stuck after step 2 and either downgrade (and hit step 5) or open a support thread.

Environment

  • openclaw: 2026.5.2 (a448042, npm latest)
  • previous: 2026.4.29 (a448042)
  • OS: Linux (Linode VPS, Singapore region)
  • Node: bundled with openclaw (v22.22.0)
  • Externalized plugins user references in config: brave, discord, voice-call

Happy to provide stability bundle, full prep-stage trace, or the exact installs.json contents for the broken state.

Activity

  1. clawsweeper commented on May 3, 2026

    @clawsweeper
    Contributor

    Codex review: keeping this open for maintainer follow-up; there is still a little grit to resolve.

    Summary
    Keep open. Current main has partial fixes for the 5.2 plugin externalization fallout, but source inspection still shows a live upgrade recovery gap: update-time doctor defers configured plugin installs, post-core plugin sync skips invalid configs, and plugins install remains blocked for the Brave invalid-config case.

    Reproducibility: yes. from source inspection. A config that selects tools.web.search.provider: "brave" without an active Brave plugin becomes invalid, package-update doctor defers the missing install under OPENCLAW_UPDATE_IN_PROGRESS, and post-core plugin sync then skips because the config is invalid.

    Next step
    This is a concrete upgrade-path bug with clear code boundaries, but it needs careful targeted tests around package-update doctor and invalid-config install recovery.

    Review details

    Best possible solution:

    Make the 5.2 externalized-plugin upgrade repair run to completion for configured official plugins before the config-valid plugin sync gate, and keep install-time invalid-config recovery narrowly scoped to the requested official plugin id.

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

    Yes, from source inspection. A config that selects tools.web.search.provider: "brave" without an active Brave plugin becomes invalid, package-update doctor defers the missing install under OPENCLAW_UPDATE_IN_PROGRESS, and post-core plugin sync then skips because the config is invalid.

    Is this the best way to solve the issue?

    No, current main is not yet the best solution. The safer repair is a narrow upgrade recovery path that installs or explicitly carries forward configured official plugin candidates instead of marking the update repair complete while the config remains invalid.

    Acceptance criteria:

    • pnpm test src/commands/doctor/shared/missing-configured-plugin-install.test.ts src/commands/doctor/shared/release-configured-plugin-installs.test.ts src/flows/doctor-health-contributions.test.ts src/cli/plugins-install-config.test.ts src/cli/plugins-cli.install.test.ts src/cli/update-cli.test.ts
    • pnpm exec oxfmt --check --threads=1 src/commands/doctor/shared/missing-configured-plugin-install.ts src/commands/doctor/shared/missing-configured-plugin-install.test.ts src/commands/doctor/shared/release-configured-plugin-installs.ts src/commands/doctor/shared/release-configured-plugin-installs.test.ts src/flows/doctor-health-contributions.ts src/flows/doctor-health-contributions.test.ts src/cli/plugin-install-config-policy.ts src/cli/plugins-install-command.ts src/cli/plugins-install-config.test.ts src/cli/plugins-cli.install.test.ts src/cli/update-cli/update-command.ts src/cli/update-cli.test.ts CHANGELOG.md
    • Before handoff on a maintainer machine, run pnpm check:changed in Testbox if runtime/config code changed.

    What I checked:

    • Web-search config can become invalid solely because an installable plugin is missing: tools.web.search.provider: "brave" is rejected when the Brave web-search provider is not active, with the exact install/doctor message described in the report. (src/config/validation.ts:1069, 31e2276fe966)
    • Official catalog maps Brave, Discord, and voice-call to external npm packages: Current main knows brave installs as @openclaw/brave-plugin; Discord and voice-call are also official external npm installs, so the reported plugin set is within the managed repair surface. (scripts/lib/official-external-plugin-catalog.json:21, 31e2276fe966)
    • Package-update doctor intentionally runs with update-in-progress set: The package update post-verify step runs doctor --non-interactive --fix with OPENCLAW_UPDATE_IN_PROGRESS=1, which changes missing plugin install repair behavior during the exact upgrade path. (src/cli/update-cli/update-command.ts:771, 31e2276fe966)
    • Update-mode missing-install repair excludes deferred plugin ids from installation: During update doctor, configured plugin ids are added to deferredPluginIds; those ids are then filtered out of missingPluginIds, so no npm install candidate is attempted in that pass. (src/commands/doctor/shared/missing-configured-plugin-install.ts:549, 31e2276fe966)
    • Post-core plugin update skips the remaining repair when config is invalid: After core update, plugin update sync returns skipped for an invalid config, which leaves the missing-plugin-invalid-config loop unresolved. (src/cli/update-cli/update-command.ts:897, 31e2276fe966)
    • Manual plugins install brave still has an invalid-config gap: plugins install loads config before the official bare-id install branch can run, and invalid-config recovery is only granted when the request has allowInvalidConfigRecovery: true; Brave does not set that flag. (src/cli/plugins-install-command.ts:422, 31e2276fe966)

    Likely related people:

    • vincentkoc: Recent commits and ClawSweeper review history concentrate the missing configured plugin repair, update-time deferral, official install trust, and external plugin catalog work in this area. (role: recent maintainer; confidence: high; commits: 9765a5777c73, 2a22eb68aafd, 4781b46056e8; files: src/commands/doctor/shared/missing-configured-plugin-install.ts, src/commands/doctor/shared/release-configured-plugin-installs.ts, src/cli/update-cli/update-command.ts)
    • bek91: Authored the current-main official bare-id install alias fix for Brave, which partially addresses the issue but still runs after config loading in the failing invalid-config path. (role: adjacent fix author; confidence: medium; commits: 411df5991608; files: src/cli/plugins-install-command.ts, src/cli/plugin-install-plan.ts, src/cli/plugins-cli.install.test.ts)
    • joshavant: The external channel contract commit is the local base for several touched update/config/plugin validation paths and is adjacent to the externalized channel recovery surface. (role: adjacent owner; confidence: low; commits: b1f8172867f3; files: src/cli/update-cli/update-command.ts, src/config/validation.ts)

    Remaining risk / open question:

    • I did not run a full packaged 2026.4.29 to 2026.5.2 update reproduction; the conclusion is from deterministic source tracing plus existing local ClawSweeper commit-review evidence.
    • The issue bundles several recovery pain points; a first fix should target the upgrade/install deadlock without broadening plugin install invalid-config bypasses.

    Codex review notes: model gpt-5.5, reasoning high; reviewed against 31e2276fe966.

  2. ForestDengHK commented on May 3, 2026

    @ForestDengHK
    Contributor

    Same scenario on macOS — adds two extra failure modes

    We hit this exact upgrade-path failure overnight via a launchd-managed auto-updater on macOS. The shape matches your report (Linux + brave/discord/voice-call), and we'd like to add two data points the OP didn't cover.

    Environment

    • macOS 26.3.1, Apple Silicon
    • Node v25.6.1
    • OpenClaw 2026.4.29 → 2026.5.2 attempt (auto-updater script run by launchd at 05:00)
    • Externalized plugins involved in our config: discord, whatsapp, voice-call
    • Plugin npm root: ~/.openclaw/npm/ (no package.json present, same as the OP)

    Failure mode 1 — sequential npm install deletes siblings

    Auto-updater's plugin-install loop runs npm install @openclaw/<one> per plugin against ~/.openclaw/npm/ (no package.json), which behaves exactly as #76571 describes. Resulting state: only the last-installed plugin (discord) survives on disk; whatsapp and voice-call package directories are gone. installs.json still records all three with installPath pointing at the now-missing dirs. The updater logs:

    Plugin install payload missing after update: package directory is missing:
    ~/.openclaw/npm/node_modules/@openclaw/whatsapp.
    Plugin install payload missing after update: package directory is missing:
    ~/.openclaw/npm/node_modules/@openclaw/voice-call.
    [...] ERROR: Update failed.
    [...] GUARDIAN: Gateway not loaded in launchd. Bootstrapping...
    [...] GUARDIAN ERROR: Failed to bootstrap gateway.
    

    After this point, launchctl bootstrap returns 5: Input/output error until manually recovered, because launchd has marked the service disabled. Visible only via launchctl print-disabled gui/$(id -u) | grep openclaw; fixed with launchctl enable gui/$(id -u)/<label> before re-bootstrapping.

    Failure mode 2 — @openclaw/whatsapp@2026.5.2 runtime crash, even after a clean install

    This is the part not covered by the existing issues we could find. After manually reinstalling all three plugins together at matched versions (npm install @openclaw/discord@2026.5.2 @openclaw/whatsapp@2026.5.2 @openclaw/voice-call@2026.5.2 in one invocation, so siblings survive), the gateway loads all 12 plugins but WhatsApp specifically crashes during channel startup:

    [gateway] http server listening (12 plugins: ..., whatsapp; ...)
    [gateway] starting channels and sidecars...
    [whatsapp] [<account>] starting provider
    [whatsapp] channel startup failed: Cannot read properties of undefined (reading 'readWebAuthState')
    

    Observation: the error originates in src/channel.ts (lines ~90, ~204, ~260) where the plugin does

    const channelRuntime = await loadWhatsAppChannelRuntime();
    return (await channelRuntime.readWebAuthState(account.authDir)) === "linked";

    and loadWhatsAppChannelRuntime() (in src/shared.ts:93, which is await import("./channel.runtime.js")) appears to resolve to undefined in our environment. discord and voice-call plugins use the same dynamic-import-of-.ts pattern and load fine — only whatsapp triggers it. We did not isolate the underlying cause.

    Reproduced on:

    • @openclaw/whatsapp@2026.5.2 ✗
    • @openclaw/whatsapp@2026.5.2-beta.2 ✗ (same error)

    Tried (no effect):

    • Clearing jiti cache (rm -rf ~/.openclaw/tmp/jiti)
    • Reinstalling all three plugins together so siblings don't get clobbered
    • openclaw plugins registry --refresh

    One extra detail on the downgrade trap

    When restoring an older binary on macOS, ~/.openclaw/service-env/<label>.env also carries OPENCLAW_SERVICE_VERSION='2026.5.2' after the partial update — we updated that to match the rolled-back binary. Worth mentioning in the suggested error-message hint alongside OPENCLAW_ALLOW_OLDER_BINARY_DESTRUCTIVE_ACTIONS=1.

    Workaround that worked

    1. npm install -g openclaw@2026.4.29 (whatsapp/discord/voice-call still bundled in core there)
    2. Remove ~/.openclaw/npm/node_modules/@openclaw/{discord,whatsapp,voice-call} (these are 2026.5.x-only)
    3. Clear jiti cache
    4. Edit ~/.openclaw/service-env/<label>.env:
      • OPENCLAW_SERVICE_VERSION='2026.4.29'
      • Add export OPENCLAW_ALLOW_OLDER_BINARY_DESTRUCTIVE_ACTIONS='1'
    5. launchctl enable gui/$(id -u)/<label>
    6. launchctl bootstrap gui/$(id -u) <plist>
    7. openclaw plugins registry --refresh

    Happy to file the readWebAuthState undefined as a separate issue if it isn't covered by something I missed — wanted to keep this thread focused on the umbrella upgrade-path story.

  3. steipete commented on May 3, 2026

    @steipete
    Contributor

    Closing as fixed on current main.

    Proof checked against d841394eba035723372a7120b34b8283514ec87e:

    • Managed npm sibling preservation is fixed by fix(plugins): preserve sibling @openclaw/* plugins during npm install #76602 / f7522edb96: plugin npm installs run from the managed npm root manifest, so installing/updating one @openclaw/* package no longer prunes previously installed siblings.
    • Configured external plugin repair is fixed by fix: repair configured plugin installs #76129 and extended by fix(config): exempt known channel ids from plugins.allow stale warning (#76872) #76879: openclaw doctor --fix installs configured missing official plugins such as Brave from @openclaw/brave-plugin, preserves configured entries when repair fails, and avoids stale-plugin cleanup during update-mode deferral.
    • The reported Brave provider-only config path is covered in src/commands/doctor/shared/missing-configured-plugin-install.test.ts: tools.web.search.provider: "brave" resolves to plugin id brave and installs @openclaw/brave-plugin into the managed npm root.
    • The package update survivor lane now has the configured-plugin-installs scenario, with assertions that Brave is externally installed under ~/.openclaw/npm/node_modules while bundled/internal plugins are not incorrectly externalized.
    • Local focused proof on current main passes: pnpm test src/commands/doctor/shared/missing-configured-plugin-install.test.ts src/commands/doctor/shared/release-configured-plugin-installs.test.ts src/commands/doctor/repair-sequencing.test.ts src/cli/program/config-guard.test.ts src/plugins/install.npm-spec.test.ts -> 82 tests passing.

    The later WhatsApp readWebAuthState crash report in this thread is a separate packaged WhatsApp runtime issue if it still reproduces on a build from current main; it is not the externalized-plugin upgrade deadlock described in the original report.

  4. jackiedepp commented on May 4, 2026

    @jackiedepp
    Author

    Confirming fix on 2026.5.3 (06d46f7) from the original reporter — upgrade path now works end-to-end.

    Walked our production install (the same Linode VPS / Singapore env from the OP) through the 4.29 → 5.3 upgrade today. End-state is clean: brave, discord, and voice-call all loaded as 2026.5.3 from ~/.openclaw/npm/node_modules/@openclaw/<pkg>/, gateway ready in 16s on the post-install restart.

    What worked vs what was broken in 5.2:

    Step 5.2 behavior (OP) 5.3 behavior
    npm install -g openclaw@<new> binary updates, externalized plugins left stale same — but now harmless
    Stale @openclaw/* packages at ~/.openclaw/npm/node_modules/ jiti-loaded TS source, ran but flaky rejected at boot with installed plugin package requires compiled runtime output warning (per #77163) and skipped from the loaded set — visible failure instead of silent degradation
    openclaw plugins update <name> failed: config-invalid blocked CLI before reaching install logic works: fetches new npm tarball with dist/, updates installs.json, prompts for restart
    openclaw plugins update brave (odd-named pkg) n/a (couldn't get there) resolves manifest id brave → npm package @openclaw/brave-plugin correctly, prints Plugin manifest id "brave" differs from npm package name "@openclaw/brave-plugin"; using manifest id as the config key and proceeds
    installs.json after updating one pkg could prune sibling installs (the regression #76602 fixed) siblings preserved across update brave, update discord, update voice-call calls
    meta.lastTouchedVersion after upgrade blocked downgrade with cryptic env-var hint bumped cleanly to 2026.5.3 on first plugin update

    Two small leftover papercuts (not blockers, worth noting for completeness):

    1. @openclaw/brave-plugin still doesn't follow the @openclaw/<id> convention that the rest of the externalized set uses. The CLI handles the lookup transparently, so it's no longer a user-visible problem during install. But anyone trying npm install -g @openclaw/brave directly (which was the natural first guess in our 5.2 walkthrough) will still 404. Renaming to @openclaw/brave — even with a deprecation alias — would close out the last bit of 5.2's "documentation says X, npm has Y" friction.

    2. The new source-only TS rejection (fix(plugins): warn on source-only installed packages instead of blocking config #77163) means an in-place 5.3 binary upgrade temporarily breaks web_search for any user whose 5.2 brave install was the source-only variant. The fix is a single openclaw plugins update brave after the binary upgrade, which is fine — but it might be worth running that as part of openclaw doctor --fix automatically when it detects an installs.json entry pointing at a TS-only package. Otherwise the gap between "binary upgraded" and "user runs CLI to fix brave" leaves web search broken with only a config warning to indicate why.

    Net: the upgrade path described in the OP is no longer broken. Thanks to @steipete and @vincentkoc for the install hardening pass — concrete improvement, and the new fail-loud-instead-of-silent behavior on bad packages is exactly the right call.

  5. locked as resolved and limited conversation to collaborators on May 6, 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

    No labels
    No labels

    Type

    No type

    Fields

    Priority

    None yet

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions