Repository navigation
fix(plugins): keep official plugin config across bundled-to-external moves, harden npm metadata parsing - #108336
Conversation
…moves, harden npm metadata parsing - doctor --fix and plugin auto-enable treat official-catalog plugin ids as known configuration even when the external package is not installed yet, so a bundled-to-external transition (codex) no longer silently drops the plugins.allow entry and unregisters the agent harness; garbage ids are still pruned, and the codex-specific diagnostic suppression in the doctor scan is replaced by the generic official-catalog rule (#107226) - npm view metadata normalization handles object and multi-version array output, flat dist.* keys and nested dist objects, absent openclaw blocks, selects the maximum satisfying semver (publication order is not semver order), fails closed when a recognized range has no satisfying entry, and names the missing fields in the error (#107842) The #107219 register-crash fix (lazy binding-store opening so plugin registration never touches runtime.state under the base runtime) landed with #108311 alongside its regression test.
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 4182c1c04d
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| if (!version || !satisfiesSemver(version, range)) { | ||
| continue; | ||
| } | ||
| if (!best || gtSemver(version, best.version)) { |
There was a problem hiding this comment.
Preserve OpenClaw correction ordering when selecting npm metadata
When this helper resolves metadata for OpenClaw range/month selectors, it now applies vanilla semver satisfies/gt even though OpenClaw treats numeric correction releases as stable and newer than their base version (src/infra/npm-registry-spec.ts:174-184). For a package line containing 2026.5.3 and the correction 2026.5.3-1, a selector such as @openclaw/[email protected]/range metadata will exclude or under-order the correction and resolve the older base tarball (or report no match), so plugin installs/updates can miss a published OpenClaw correction.
Useful? React with 👍 / 👎.
|
Merged via squash.
|
…moves, harden npm metadata parsing (openclaw#108336) * fix(plugins): keep official plugin config across bundled-to-external moves, harden npm metadata parsing - doctor --fix and plugin auto-enable treat official-catalog plugin ids as known configuration even when the external package is not installed yet, so a bundled-to-external transition (codex) no longer silently drops the plugins.allow entry and unregisters the agent harness; garbage ids are still pruned, and the codex-specific diagnostic suppression in the doctor scan is replaced by the generic official-catalog rule (openclaw#107226) - npm view metadata normalization handles object and multi-version array output, flat dist.* keys and nested dist objects, absent openclaw blocks, selects the maximum satisfying semver (publication order is not semver order), fails closed when a recognized range has no satisfying entry, and names the missing fields in the error (openclaw#107842) The openclaw#107219 register-crash fix (lazy binding-store opening so plugin registration never touches runtime.state under the base runtime) landed with openclaw#108311 alongside its regression test. * style: format install-source-utils imports
…moves, harden npm metadata parsing (openclaw#108336) * fix(plugins): keep official plugin config across bundled-to-external moves, harden npm metadata parsing - doctor --fix and plugin auto-enable treat official-catalog plugin ids as known configuration even when the external package is not installed yet, so a bundled-to-external transition (codex) no longer silently drops the plugins.allow entry and unregisters the agent harness; garbage ids are still pruned, and the codex-specific diagnostic suppression in the doctor scan is replaced by the generic official-catalog rule (openclaw#107226) - npm view metadata normalization handles object and multi-version array output, flat dist.* keys and nested dist objects, absent openclaw blocks, selects the maximum satisfying semver (publication order is not semver order), fails closed when a recognized range has no satisfying entry, and names the missing fields in the error (openclaw#107842) The openclaw#107219 register-crash fix (lazy binding-store opening so plugin registration never touches runtime.state under the base runtime) landed with openclaw#108311 alongside its regression test. * style: format install-source-utils imports
What Problem This Solves
Three install/doctor resilience bugs around the codex bundled→external transition:
doctor --fixsilently drops theplugins.allowentry for a bundled→externalized plugin (codex), unregistering the agent harness — and the gateway still reports healthy #107226 —doctor --fixsilently dropped theplugins.allowentry for a bundled→externalized plugin (codex) on machines where the external package was not yet installed: the doctor stale-config scan and plugin auto-enable only accepted ids from the discovered manifest registry, so an official-but-not-installed id looked like garbage. That unregistered the agent harness while the gateway reported healthy.npm view <spec> … --jsonmetadata normalization only unwrapped singleton arrays and one dist shape; multi-version output, dotted vs nesteddistkeys, or an absentopenclawblock collapsed to "npm view produced incomplete package metadata" and blocked gateway startup during@openclaw/codexinstall.register()calledapi.runtime.state.openSyncKeyedStoreeagerly, and the base (non-proxied) plugin runtime rejects state access by design (src/plugins/runtime/index.ts:334-341).Why This Change Was Made
installeddiagnostics remain actionable), and only genuinely unknown ids are pruned. This also deletes the codex-specificshouldSuppressMissingCodexPluginDiagnosticsspecial case from the doctor scan in favor of the generic rule — one fewer hardcoded plugin id in core.dist.*and nesteddistshapes, tolerates missingopenclawblocks, and names the missing fields in the error.openSyncKeyedStoreto first binding use, so control-plane loads (CLI suggestions use manifest/light metadata — verified:src/plugins/cli-registry-loader.ts,extensions/codex/cli-metadata.ts) can never crash on state access.User Impact
openclaw plugins install/ gateway startup survives npm registry metadata shape variance and never pins a version outside the requested range.Evidence
Fixes #107226
Fixes #107842
Fixes #107219