Skip to content

fix(openclaw): drop unsupported --force from linked plugin install - #21

Open
Alexgodoroja wants to merge 1 commit into
pilot-protocol:mainfrom
Alexgodoroja:fix/openclaw-link-force-conflict
Open

fix(openclaw): drop unsupported --force from linked plugin install#21
Alexgodoroja wants to merge 1 commit into
pilot-protocol:mainfrom
Alexgodoroja:fix/openclaw-link-force-conflict

Conversation

@Alexgodoroja

Copy link
Copy Markdown

What happens now

npx [email protected] attach --openclaw fails outright:

pilot-mcp: Command failed: openclaw plugins install --link --force ~/.pilot/integrations/openclaw-policy
--force is not supported with --link. Linked plugins point at the source path directly;
remove --force and re-run openclaw plugins install --link <path>.

src/setup/harnesses/openclaw.js passes both flags, and OpenClaw treats them as mutually
exclusive — a linked plugin points at the source path, so there is no copy to overwrite.

Why it's worse than one failed command

configure() runs install, enable and inspect inside a single try, so the throw on the
first step means none of them run and pilot-policy is never registered. The cpSync on
line 22 has already populated ~/.pilot/integrations/openclaw-policy by that point, so the
user is left with plugin files on disk and nothing installed against them — plugins list
shows no pilot-policy, which reads like the copy silently did nothing.

Fix

Drop --force. It was redundant anyway: a linked install points at installedPlugin, and
cpSync(..., { force: true }) refreshes those files on every run, so re-attaching stays
idempotent without it.

Why CI didn't catch it

The test stubbed openclaw with a shell script that logged argv and always exited 0, so it
happily accepted a flag pair the real CLI refuses, and assert.match(calls, /--link\n--force/)
actively pinned the broken behaviour. The stub now mirrors the real CLI and rejects the
combination; reintroducing --force fails the test (confirmed by re-adding it locally).

Verification

Against OpenClaw 2026.7.1-2 on macOS, all three steps now succeed and
plugins inspect pilot-policy --json reports status: "loaded", enabled: true.

node --test test/native-harness-setup.test.js → 8/8 pass. npm run lint clean.

Full npm test is 55 pass / 7 fail, but that failure set is identical on unmodified main
(test/attach.test.js, harness-config-contracts, hermes-setup, manifest, two OpenClaw
plugin hook tests, and the stdio initialize smoke test). All pre-existing and untouched here.

OpenClaw rejects --force alongside --link ("Linked plugins point at the
source path directly"), so `attach --openclaw` aborted on the first of the
three CLI steps. Because install, enable and inspect share one try block,
the plugin was never registered at all -- while the cpSync above had already
populated ~/.pilot/integrations/openclaw-policy, leaving users with plugin
files on disk and nothing installed against them.

--force was redundant regardless: a linked install points at installedPlugin,
which cpSync refreshes on every run, so re-attaching stays idempotent without it.

The test stub logged argv and always exited 0, so it accepted a flag pair the
real CLI refuses and the bug shipped green. It now mirrors the CLI and rejects
the combination, which fails the test if --force is reintroduced.

Verified against OpenClaw 2026.7.1-2: install, enable and inspect all succeed,
and the plugin reports status "loaded".
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant