Skip to content

[Bug]: openclaw plugin installation overwrites existing plugin list configuration #512

@qin-ctx

Description

@qin-ctx

Bug Description

The openclaw-memory-plugin installation process overwrites existing plugins.allow and plugins.load.paths configuration instead of appending to them, causing previously installed plugins to be lost.

Steps to Reproduce

  1. Install any existing openclaw plugin so that plugins.allow and plugins.load.paths already have entries
  2. Run the openclaw-memory-plugin installer (either via install.sh or setup-helper/cli.js)
  3. Inspect the config — previously registered plugins are gone

Expected Behavior

The installer should read the existing plugin list and append the new plugin entry, preserving all previously configured plugins.

Actual Behavior

The existing plugin list is overwritten with an array containing only the newly installed plugin. Three separate code paths have this issue:

  1. setup-helper/cli.js:531 — Directly overwrites plugins.load.paths with [pluginPath] (single-element array), discarding all existing paths.
  2. setup-helper/cli.js:536-542 — Reads existing plugins.allow via run() but accesses raw.stdout incorrectly (likely undefined), falls back to [], effectively wiping the allow list.
  3. install.sh:612-629 — Uses sed to manipulate JSON arrays, which is unreliable and can produce malformed JSON in edge cases (special characters, empty arrays, multiline content).

Minimal Reproducible Example

// cli.js line 531 — this overwrites instead of appending:
await runNoShell("openclaw", ["config", "set", "plugins.load.paths", JSON.stringify([pluginPath])], { silent: true }).catch(() => {});

// Should be (read-then-append), similar to the correct pattern at lines 491-493:
// const paths = Array.isArray(existing) ? existing : [];
// if (!paths.includes(pluginPath)) paths.push(pluginPath);
// then set plugins.load.paths to the merged array

Error Logs

No error logs — the overwrite happens silently.

OpenViking Version

latest (main branch)

Python Version

N/A (TypeScript/Bash code)

Operating System

All (Linux, macOS, Windows)

Additional Context

The JSON-mode code path (cli.js:485-493) already implements the correct read-then-append pattern and can serve as a reference for fixing the other code paths.

Metadata

Metadata

Assignees

Labels

bugSomething isn't working

Type

No type

Projects

Status

Done

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions