openclaw - 💡(How to fix) Fix v2026.5.20 post-update Codex plugin sync can wedge managed npm root with npm ERR_INVALID_ARG_TYPE

Official PRs (…)
ON THIS PAGE

Recommended Tools

×6

Utilities matched from this issue’s tags and category — try them while you read without losing context.

GitHub issue graph ai analysis

Paste a GitHub issue URL. We fetch that issue, discover linked issues from bodies/comments/timeline, collect linked pull requests, and produce a structured English report.

The report is written in English Markdown for sharing and archival.

Helpful · Quick feedback

Loading…

During an update from 2026.5.19 to 2026.5.20, the core package update succeeded, but the post-update plugin sync failed while installing the official @openclaw/codex plugin into the managed npm plugin root. This left the Codex harness unregistered and caused Codex-routed cron/channel sessions to fail.

This appears to be a managed npm-root/reify resilience issue rather than a bad @openclaw/[email protected] tarball: after quarantining the existing ~/.openclaw/npm/node_modules tree and letting OpenClaw rebuild it, the same plugin installed successfully and openclaw plugins doctor reported no plugin issues.

Release involved: https://github.com/openclaw/openclaw/releases/tag/v2026.5.20

Error Message

Installing @openclaw/codex into /Users/allenhurff/.openclaw/npm... Downloading @openclaw/codex... Extracting .../openclaw-codex-2026.5.20.tgz... npm install failed: npm error code ERR_INVALID_ARG_TYPE npm error The "from" argument must be of type string. Received undefined Also not a valid hook pack: Error: package.json missing openclaw.hooks

Root Cause

A rollback attempt to 2026.5.19 also became confusing because the config had already been written by 2026.5.20, and the older binary refused gateway destructive/restart actions without OPENCLAW_ALLOW_OLDER_BINARY_DESTRUCTIVE_ACTIONS=1.

Code Example

openclaw update --tag 2026.5.20 --yes

---

Update Result: OK
  Root: /opt/homebrew/lib/node_modules/openclaw
  Before: 2026.5.19
  After: 2026.5.20

---

Installing @openclaw/codex into /Users/allenhurff/.openclaw/npm...
Linked peerDependency "openclaw" -> /opt/homebrew/lib/node_modules/openclaw
Linked peerDependency "openclaw" -> /opt/homebrew/lib/node_modules/openclaw
Disabled "codex" after plugin update failure; OpenClaw will continue without it. Failed to update codex: npm install failed: npm error code ERR_INVALID_ARG_TYPE
npm error The "from" argument must be of type string. Received undefined
npm error A complete log of this run can be found in: /Users/allenhurff/.npm/_logs/2026-05-21T21_21_58_750Z-debug-0.log

---

Installing @openclaw/codex into /Users/allenhurff/.openclaw/npm...
Downloading @openclaw/codex...
Extracting .../openclaw-codex-2026.5.20.tgz...
npm install failed: npm error code ERR_INVALID_ARG_TYPE
npm error The "from" argument must be of type string. Received undefined
Also not a valid hook pack: Error: package.json missing openclaw.hooks

---

verbose cwd /Users/allenhurff/.openclaw/npm
verbose node v24.14.1
verbose npm  v11.11.0
verbose stack TypeError [ERR_INVALID_ARG_TYPE]: The "from" argument must be of type string. Received undefined
verbose stack     at relative (node:path:1357:5)
verbose stack     at /opt/homebrew/Cellar/node@24/24.14.1/lib/node_modules/npm/node_modules/@npmcli/arborist/lib/arborist/reify.js:1184:21
verbose stack     at Array.map (<anonymous>)
verbose stack     at /opt/homebrew/Cellar/node@24/24.14.1/lib/node_modules/npm/node_modules/@npmcli/arborist/lib/arborist/reify.js:1182:66
verbose stack     at Array.map (<anonymous>)
verbose stack     at [rollbackMoveBackRetiredUnchanged] (/opt/homebrew/Cellar/node@24/24.14.1/lib/node_modules/npm/node_modules/@npmcli/arborist/lib/arborist/reify.js:1182:8)
verbose stack     at #reifyPackages (/opt/homebrew/Cellar/node@24/24.14.1/lib/node_modules/npm/node_modules/@npmcli/arborist/lib/arborist/reify.js:315:31)
verbose stack     at async Arborist.reify (/opt/homebrew/Cellar/node@24/24.14.1/lib/node_modules/npm/node_modules/@npmcli/arborist/lib/arborist/reify.js:121:5)
verbose stack     at async Install.exec (/opt/homebrew/Cellar/node@24/24.14.1/lib/node_modules/npm/lib/commands/install.js:152:5)
verbose stack     at async Npm.exec (/opt/homebrew/Cellar/node@24/24.14.1/lib/node_modules/npm/lib/npm.js:209:9)

---

Plugin "codex" failed post-core payload smoke check (missing-package-dir): Install dir is missing: /Users/allenhurff/.openclaw/npm/node_modules/@openclaw/codex

---

MissingAgentHarnessError: Requested agent harness "codex" is not registered.

---

stamp=$(date +%Y%m%d-%H%M%S)
mkdir -p ~/.openclaw/manual-backups

tar -czf ~/.openclaw/manual-backups/${stamp}-openclaw-npm-before-repair.tgz -C ~/.openclaw npm

if [ -d "$HOME/.openclaw/npm/node_modules" ]; then
  mv "$HOME/.openclaw/npm/node_modules" "$HOME/.openclaw/npm-node_modules.broken-$stamp"
fi

rm -f "$HOME/.openclaw/npm/package-lock.json" "$HOME/.openclaw/npm/npm-shrinkwrap.json"

openclaw plugins install @martian-engineering/lossless-claw@latest --force
openclaw plugins update acpx
openclaw plugins update memory-lancedb
openclaw plugins install @openclaw/codex --force
openclaw plugins update discord
openclaw plugins registry --refresh
openclaw plugins doctor
openclaw gateway restart --wait 45s
openclaw status --deep

---

Installed plugin: codex
No plugin issues detected.
Gateway reachable
Memory enabled (plugin memory-lancedb)
RAW_BUFFERClick to expand / collapse

Summary

During an update from 2026.5.19 to 2026.5.20, the core package update succeeded, but the post-update plugin sync failed while installing the official @openclaw/codex plugin into the managed npm plugin root. This left the Codex harness unregistered and caused Codex-routed cron/channel sessions to fail.

This appears to be a managed npm-root/reify resilience issue rather than a bad @openclaw/[email protected] tarball: after quarantining the existing ~/.openclaw/npm/node_modules tree and letting OpenClaw rebuild it, the same plugin installed successfully and openclaw plugins doctor reported no plugin issues.

Release involved: https://github.com/openclaw/openclaw/releases/tag/v2026.5.20

Environment

  • macOS arm64
  • OpenClaw before update: 2026.5.19 (a185ca2)
  • OpenClaw after core update: 2026.5.20 (e510042)
  • which openclaw: /opt/homebrew/bin/openclaw
  • OpenClaw root reported by update: /opt/homebrew/lib/node_modules/openclaw
  • Node from npm debug log: v24.14.1
  • npm from npm debug log: 11.11.0
  • npm install cwd from debug log: ~/.openclaw/npm
  • Active slots before update: contextEngine=lossless-claw, memory=memory-lancedb

What happened

  1. Started on 2026.5.19.
  2. Ran:
openclaw update --tag 2026.5.20 --yes
  1. Core update completed successfully:
Update Result: OK
  Root: /opt/homebrew/lib/node_modules/openclaw
  Before: 2026.5.19
  After: 2026.5.20
  1. Post-update plugin sync then failed while processing Codex:
Installing @openclaw/codex into /Users/allenhurff/.openclaw/npm...
Linked peerDependency "openclaw" -> /opt/homebrew/lib/node_modules/openclaw
Linked peerDependency "openclaw" -> /opt/homebrew/lib/node_modules/openclaw
Disabled "codex" after plugin update failure; OpenClaw will continue without it. Failed to update codex: npm install failed: npm error code ERR_INVALID_ARG_TYPE
npm error The "from" argument must be of type string. Received undefined
npm error A complete log of this run can be found in: /Users/allenhurff/.npm/_logs/2026-05-21T21_21_58_750Z-debug-0.log
  1. Subsequent attempts to manually repair with openclaw plugins install @openclaw/codex --force failed the same way:
Installing @openclaw/codex into /Users/allenhurff/.openclaw/npm...
Downloading @openclaw/codex...
Extracting .../openclaw-codex-2026.5.20.tgz...
npm install failed: npm error code ERR_INVALID_ARG_TYPE
npm error The "from" argument must be of type string. Received undefined
Also not a valid hook pack: Error: package.json missing openclaw.hooks

The package.json missing openclaw.hooks line appears to be secondary/misleading fallback noise after the npm install failure.

Relevant npm debug stack

From the npm debug log:

verbose cwd /Users/allenhurff/.openclaw/npm
verbose node v24.14.1
verbose npm  v11.11.0
verbose stack TypeError [ERR_INVALID_ARG_TYPE]: The "from" argument must be of type string. Received undefined
verbose stack     at relative (node:path:1357:5)
verbose stack     at /opt/homebrew/Cellar/node@24/24.14.1/lib/node_modules/npm/node_modules/@npmcli/arborist/lib/arborist/reify.js:1184:21
verbose stack     at Array.map (<anonymous>)
verbose stack     at /opt/homebrew/Cellar/node@24/24.14.1/lib/node_modules/npm/node_modules/@npmcli/arborist/lib/arborist/reify.js:1182:66
verbose stack     at Array.map (<anonymous>)
verbose stack     at [rollbackMoveBackRetiredUnchanged] (/opt/homebrew/Cellar/node@24/24.14.1/lib/node_modules/npm/node_modules/@npmcli/arborist/lib/arborist/reify.js:1182:8)
verbose stack     at #reifyPackages (/opt/homebrew/Cellar/node@24/24.14.1/lib/node_modules/npm/node_modules/@npmcli/arborist/lib/arborist/reify.js:315:31)
verbose stack     at async Arborist.reify (/opt/homebrew/Cellar/node@24/24.14.1/lib/node_modules/npm/node_modules/@npmcli/arborist/lib/arborist/reify.js:121:5)
verbose stack     at async Install.exec (/opt/homebrew/Cellar/node@24/24.14.1/lib/node_modules/npm/lib/commands/install.js:152:5)
verbose stack     at async Npm.exec (/opt/homebrew/Cellar/node@24/24.14.1/lib/node_modules/npm/lib/npm.js:209:9)

The log also showed npm retiring/moving existing plugin packages in the shared managed root immediately before the crash, including packages under ~/.openclaw/npm/node_modules.

User-visible impact

After the failed post-update plugin sync, Codex was disabled/missing:

Plugin "codex" failed post-core payload smoke check (missing-package-dir): Install dir is missing: /Users/allenhurff/.openclaw/npm/node_modules/@openclaw/codex

Codex-routed work then failed with:

MissingAgentHarnessError: Requested agent harness "codex" is not registered.

A rollback attempt to 2026.5.19 also became confusing because the config had already been written by 2026.5.20, and the older binary refused gateway destructive/restart actions without OPENCLAW_ALLOW_OLDER_BINARY_DESTRUCTIVE_ACTIONS=1.

Recovery that worked

The successful recovery was to quarantine the entire managed npm node_modules tree and let OpenClaw rebuild it:

stamp=$(date +%Y%m%d-%H%M%S)
mkdir -p ~/.openclaw/manual-backups

tar -czf ~/.openclaw/manual-backups/${stamp}-openclaw-npm-before-repair.tgz -C ~/.openclaw npm

if [ -d "$HOME/.openclaw/npm/node_modules" ]; then
  mv "$HOME/.openclaw/npm/node_modules" "$HOME/.openclaw/npm-node_modules.broken-$stamp"
fi

rm -f "$HOME/.openclaw/npm/package-lock.json" "$HOME/.openclaw/npm/npm-shrinkwrap.json"

openclaw plugins install @martian-engineering/lossless-claw@latest --force
openclaw plugins update acpx
openclaw plugins update memory-lancedb
openclaw plugins install @openclaw/codex --force
openclaw plugins update discord
openclaw plugins registry --refresh
openclaw plugins doctor
openclaw gateway restart --wait 45s
openclaw status --deep

After that:

Installed plugin: codex
No plugin issues detected.
Gateway reachable
Memory enabled (plugin memory-lancedb)

Expected behavior

  • openclaw update --tag 2026.5.20 --yes should not leave the configured Codex runtime/harness unavailable because npm's shared managed plugin root is in a bad state.
  • If the managed npm root is corrupt or npm Arborist hits this rollback failure, OpenClaw should either:
    • detect and quarantine/rebuild the managed npm plugin node_modules tree automatically, or
    • emit an explicit recovery command that rebuilds the managed npm root.
  • The fallback Also not a valid hook pack: package.json missing openclaw.hooks message should probably be suppressed or clarified when npm install has already failed for an npm plugin package.
  • Downgrade/rollback guidance should account for the config last written by newer version guard, since a failed post-update plugin sync can leave users with a newer config stamp but a broken runtime.

Why I think this is not simply a broken Codex tarball

The same @openclaw/[email protected] package installed successfully after the shared managed npm root was rebuilt. The package metadata also appears to include normal OpenClaw plugin metadata (openclaw.runtimeExtensions, openclaw.install, peerDependencies.openclaw >=2026.5.20). The observed crash happens inside npm Arborist rollback while reifying the existing shared npm tree.

Vote matrix · Quick signals

Works
Did the solution work? Tap to confirm.
Easy Fix
Was it a quick fix?
Time Saver
Did it save you time?
Blocking
Was it severely blocking?
Common Issue
Are others likely hitting this too?
Flaky / Intermittent
Is it intermittent?
Verified / Reproducible
Can you reproduce it reliably?
Loading…

FAQ

Expected behavior

  • openclaw update --tag 2026.5.20 --yes should not leave the configured Codex runtime/harness unavailable because npm's shared managed plugin root is in a bad state.
  • If the managed npm root is corrupt or npm Arborist hits this rollback failure, OpenClaw should either:
    • detect and quarantine/rebuild the managed npm plugin node_modules tree automatically, or
    • emit an explicit recovery command that rebuilds the managed npm root.
  • The fallback Also not a valid hook pack: package.json missing openclaw.hooks message should probably be suppressed or clarified when npm install has already failed for an npm plugin package.
  • Downgrade/rollback guidance should account for the config last written by newer version guard, since a failed post-update plugin sync can leave users with a newer config stamp but a broken runtime.

Still need to ship something?

×6

Another batch ranked right after the header list — different links, same matching logic.

Back to top recommendations

TRENDING