openclaw - ✅(Solved) Fix openclaw plugins install crashes with validateConfigObjectRawWithPlugins on fresh 2026.4.5 install [1 pull requests, 1 participants]

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…
GitHub stats
openclaw/openclaw#61841Fetched 2026-04-08 02:53:43
View on GitHub
Comments
0
Participants
1
Timeline
2
Reactions
0
Author
Participants
Timeline (top)
closed ×1cross-referenced ×1

openclaw plugins install crashes during persistPluginInstall on a fresh 2026.4.5 install (no existing config). The config validation step after writing the plugin config fails with an unhandled error in validateConfigObjectRawWithPlugins.

This does NOT reproduce on 2026.4.2.

Error Message

at validateConfigObjectWithPluginsBase (.../openclaw/dist/io-CS2J_l4V.js:17322:64)
at validateConfigObjectRawWithPlugins (.../openclaw/dist/io-CS2J_l4V.js:17316:9)
at Object.writeConfigFile (.../openclaw/dist/io-CS2J_l4V.js:19095:21)
at async writeConfigFile (.../openclaw/dist/io-CS2J_l4V.js:19337:22)
at async replaceConfigFile (.../openclaw/dist/config-dzPpvDz6.js:19:2)
at async persistPluginInstall (.../openclaw/dist/plugins-install-persist-b4KWEPYx.js:95:2)
at async runPluginInstallCommand (.../openclaw/dist/plugins-update-command-BlR5reha.js:612:3)

Root Cause

openclaw plugins install crashes during persistPluginInstall on a fresh 2026.4.5 install (no existing config). The config validation step after writing the plugin config fails with an unhandled error in validateConfigObjectRawWithPlugins.

This does NOT reproduce on 2026.4.2.

Fix Action

Workaround

Use 2026.4.2 or manually extract plugin tarballs to the extensions directory without using openclaw plugins install.

PR fix notes

PR #61856: fix(config): restore applyDefaults:true for AJV plugin/channel schema validation

Description (problem / solution / changelog)

Summary

  • Problem: openclaw plugins install crashes with validateConfigObjectRawWithPlugins on a fresh v2026.4.5 install. AJV plugin/channel schema validation rejects configs that rely on default values for required fields when applyDefaults is false.
  • Why it matters: This is a regression from v2026.4.2 → v2026.4.5 that completely blocks plugin installation on fresh systems. Any third-party plugin with a configSchema containing required-but-defaulted fields fails.
  • What changed: Restored applyDefaults: true for the AJV validateJsonSchemaValue calls in validateConfigObjectWithPluginsBase (both channel and plugin schema validation paths). This was the pre-4.5 behavior.
  • What did NOT change (scope boundary): The outer Zod validation's applyDefaults flag remains caller-controlled. The persistCandidate write-path mechanism (which prevents AJV-injected defaults from being written to disk) is untouched.

Change Type (select all)

  • Bug fix
  • Feature
  • Refactor required for the fix
  • Docs
  • Security hardening
  • Chore/infra

Scope (select all touched areas)

  • Gateway / orchestration
  • Skills / tool execution
  • Auth / tokens
  • Memory / storage
  • Integrations
  • API / contracts
  • UI / DX
  • CI/CD / infra

Linked Issue/PR

  • Closes #61841
  • Related #56772 (the original issue that motivated the persistCandidate mechanism)
  • This PR fixes a bug or regression

Root Cause (if applicable)

  • Root cause: Commits 40ffada812 and 97878b853a changed applyDefaults: true to applyDefaults: opts.applyDefaults in the AJV validateJsonSchemaValue calls for both channel and plugin config schemas. When writeConfigFilevalidateConfigObjectRawWithPlugins calls validation with applyDefaults: false, AJV no longer injects schema defaults before checking required constraints. Any plugin whose configSchema has required fields with default values (e.g., the opik plugin) fails validation on a fresh install where no explicit config exists yet.
  • Missing detection / guardrail: No test existed for the scenario of validating a fresh/empty plugin config entry against a schema with required-but-defaulted fields.
  • Contributing context: The refactor to move legacy config migration behind doctor correctly avoided persisting AJV defaults to disk, but the validation-gating path was inadvertently tightened. The existing persistCandidate mechanism (documented at src/config/io.ts:2148-2154) already prevents AJV defaults from leaking into the persisted config, so applyDefaults: true during validation is safe.

Regression Test Plan (if applicable)

  • Coverage level that should have caught this:
    • Unit test
    • Seam / integration test
    • End-to-end test
    • Existing coverage already sufficient
  • Target test or file: src/config/validation.channel-metadata.test.ts or a new src/config/validation.plugin-defaults.test.ts
  • Scenario the test should lock in: Validate a config with an enabled plugin whose configSchema has a required field with a default value, where the plugin entry has no explicit config key (i.e., entry?.config ?? {}). Validation should pass.
  • Why this is the smallest reliable guardrail: Directly exercises the AJV validation path with the exact edge case that caused the crash.
  • If no new test is added, why not: The existing test infrastructure requires bundled plugin manifests to be discoverable, which fails in the current local test environment (pre-existing loadPluginManifestRegistry error unrelated to this change). A test can be added once the test environment issue is resolved.

User-visible / Behavior Changes

  • openclaw plugins install no longer crashes on fresh installs (v2026.4.5 regression).
  • No other behavior changes; validated configs are still not persisted with AJV-injected defaults.

Diagram (if applicable)

Before (v2026.4.5):
[fresh install] -> [plugins install] -> [validateConfigObjectRawWithPlugins(applyDefaults:false)]
  -> [AJV rejects {} for required fields] -> CRASH

After (this fix):
[fresh install] -> [plugins install] -> [validateConfigObjectRawWithPlugins(applyDefaults:false)]
  -> [AJV validates with defaults applied] -> [persistCandidate written without defaults] -> SUCCESS

Security Impact (required)

  • New permissions/capabilities? No
  • Secrets/tokens handling changed? No
  • New/changed network calls? No
  • Command/tool execution surface changed? No
  • Data access scope changed? No

Repro + Verification

Environment

  • OS: Any (reproduced with Docker per issue)
  • Runtime/container: Node 22+, fresh install
  • Model/provider: N/A
  • Integration/channel (if any): N/A
  • Relevant config (redacted): Fresh install with no existing ~/.openclaw/config.yaml

Steps

  1. Fresh install openclaw v2026.4.5 (e.g., via Docker as described in #61841)
  2. Run openclaw plugins install <any-plugin-with-defaulted-required-config>
  3. Observe crash at validateConfigObjectRawWithPlugins

Expected

  • Plugin installs successfully

Actual

  • Crashes with validation error on required fields that have schema defaults

Evidence

  • Trace/log snippets (see issue #61841 for full stack trace and Dockerfile repro)
  • Code analysis: git log --oneline confirms regression commits, src/config/io.ts:2148-2154 documents the persistCandidate safety mechanism

Human Verification (required)

  • Verified scenarios: Code review of the regression commits (40ffada812, 97878b853a), confirmed that persistCandidate mechanism at io.ts:2148-2154 prevents AJV defaults from being persisted, verified the diff is a minimal 2-line revert to pre-regression behavior.
  • Edge cases checked: Verified that the Zod outer validation applyDefaults flag is NOT affected by this change. Confirmed channel schema path has the same issue and fix.
  • What you did not verify: Full Docker-based end-to-end reproduction (requires Docker environment); the local test suite has a pre-existing environment issue with loadPluginManifestRegistry.

Review Conversations

  • I replied to or resolved every bot review conversation I addressed in this PR.
  • I left unresolved only the conversations that still need reviewer or maintainer judgment.

Compatibility / Migration

  • Backward compatible? Yes
  • Config/env changes? No
  • Migration needed? No

Risks and Mitigations

  • Risk: AJV defaults could theoretically leak into persisted config if the persistCandidate mechanism is bypassed.
    • Mitigation: persistCandidate is well-documented and tested (issue #56772). This fix restores the exact behavior from v2026.4.2, which worked correctly with persistCandidate.

Changed files

  • CHANGELOG.md (modified, +2/-0)
  • src/config/validation.channel-metadata.test.ts (modified, +58/-0)
  • src/config/validation.ts (modified, +4/-2)

Code Example

FROM node:22-slim
RUN corepack enable && corepack prepare pnpm@10.30.2 --activate
RUN pnpm install -g openclaw@2026.4.5
# Remove bundled plugins that fail to load (@buape/carbon missing)
RUN EXT_DIR=$(find /root/.local/share/pnpm -path '*/openclaw/dist/extensions' -type d | head -1) \
    && rm -rf "$EXT_DIR"/device-pair* "$EXT_DIR"/phone-control* "$EXT_DIR"/talk-voice* "$EXT_DIR"/browser*
RUN npm pack @opik/opik-openclaw@0.2.9 --quiet \
    && openclaw plugins install /tmp/opik-opik-openclaw-0.2.9.tgz

---

at validateConfigObjectWithPluginsBase (.../openclaw/dist/io-CS2J_l4V.js:17322:64)
at validateConfigObjectRawWithPlugins (.../openclaw/dist/io-CS2J_l4V.js:17316:9)
at Object.writeConfigFile (.../openclaw/dist/io-CS2J_l4V.js:19095:21)
at async writeConfigFile (.../openclaw/dist/io-CS2J_l4V.js:19337:22)
at async replaceConfigFile (.../openclaw/dist/config-dzPpvDz6.js:19:2)
at async persistPluginInstall (.../openclaw/dist/plugins-install-persist-b4KWEPYx.js:95:2)
at async runPluginInstallCommand (.../openclaw/dist/plugins-update-command-BlR5reha.js:612:3)
RAW_BUFFERClick to expand / collapse

Description

openclaw plugins install crashes during persistPluginInstall on a fresh 2026.4.5 install (no existing config). The config validation step after writing the plugin config fails with an unhandled error in validateConfigObjectRawWithPlugins.

This does NOT reproduce on 2026.4.2.

Steps to Reproduce

FROM node:22-slim
RUN corepack enable && corepack prepare [email protected] --activate
RUN pnpm install -g [email protected]
# Remove bundled plugins that fail to load (@buape/carbon missing)
RUN EXT_DIR=$(find /root/.local/share/pnpm -path '*/openclaw/dist/extensions' -type d | head -1) \
    && rm -rf "$EXT_DIR"/device-pair* "$EXT_DIR"/phone-control* "$EXT_DIR"/talk-voice* "$EXT_DIR"/browser*
RUN npm pack @opik/[email protected] --quiet \
    && openclaw plugins install /tmp/opik-opik-openclaw-0.2.9.tgz

Error

at validateConfigObjectWithPluginsBase (.../openclaw/dist/io-CS2J_l4V.js:17322:64)
at validateConfigObjectRawWithPlugins (.../openclaw/dist/io-CS2J_l4V.js:17316:9)
at Object.writeConfigFile (.../openclaw/dist/io-CS2J_l4V.js:19095:21)
at async writeConfigFile (.../openclaw/dist/io-CS2J_l4V.js:19337:22)
at async replaceConfigFile (.../openclaw/dist/config-dzPpvDz6.js:19:2)
at async persistPluginInstall (.../openclaw/dist/plugins-install-persist-b4KWEPYx.js:95:2)
at async runPluginInstallCommand (.../openclaw/dist/plugins-update-command-BlR5reha.js:612:3)

Environment

  • OpenClaw: 2026.4.5 (fresh install via pnpm, no existing config)
  • Node: 22
  • OS: Debian 12 (Docker)
  • Plugin: @opik/[email protected] (also reproduces with composio plugin)

Notes

  • Works fine on 2026.4.2
  • The opik plugin installs successfully (files land in ~/.openclaw/extensions/) but the post-install config write crashes
  • openclaw doctor --fix before plugin install does not help (no config to fix on a fresh install)
  • This blocks Docker-based artifact builds that need to pre-install plugins

Workaround

Use 2026.4.2 or manually extract plugin tarballs to the extensions directory without using openclaw plugins install.

extent analysis

TL;DR

Downgrade to OpenClaw version 2026.4.2 to avoid the config validation error during plugin installation.

Guidance

  • The issue seems to be related to a regression in the validateConfigObjectRawWithPlugins function introduced in version 2026.4.5.
  • To verify the issue, try installing the same plugin on version 2026.4.2 and see if the installation succeeds.
  • As a temporary workaround, manually extract the plugin tarball to the extensions directory without using openclaw plugins install.
  • Consider reporting this issue to the OpenClaw maintainers to get a proper fix for version 2026.4.5.

Example

No code example is provided as the issue is related to a specific version of OpenClaw and its interaction with plugins.

Notes

The provided workaround using version 2026.4.2 may not be suitable for all environments, especially if other features or fixes in version 2026.4.5 are required.

Recommendation

Apply the workaround by downgrading to version 2026.4.2, as it is a known working version and the issue is likely to be fixed in a future release.

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…

Still need to ship something?

×6

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

Back to top recommendations

TRENDING