Skip to content

fix(openclaw): stop stamping stale version, add --no-always opt-out - #720

Open
pierrz wants to merge 1 commit into
JuliusBrussee:mainfrom
pierrz:fix/openclaw-installer-version-and-always-opt-out
Open

fix(openclaw): stop stamping stale version, add --no-always opt-out#720
pierrz wants to merge 1 commit into
JuliusBrussee:mainfrom
pierrz:fix/openclaw-installer-version-and-always-opt-out

Conversation

@pierrz

@pierrz pierrz commented Jul 18, 2026

Copy link
Copy Markdown

Problem

Found while integrating caveman into an OpenClaw deployment and reading bin/lib/openclaw.js:

  1. Stale version stamp. SKILL_VERSION = '1.0.0' is hardcoded and gets written into every installed skill's frontmatter regardless of the actual release β€” currently v1.9.1. openclaw skills list reports a version that's never been accurate since the constant was introduced.
  2. No opt-out for always-on. installOpenclaw() unconditionally stamps always: true and writes the SOUL.md bootstrap block. There's no flag to install caveman as a discoverable, load-on-demand skill only (which the module's own top-of-file comment describes as a supported mode β€” "Skills there... are loaded on-demand by the model" β€” but nothing in the installer actually lets you land in that mode).

Fix

Both scoped narrowly, no default-behavior change:

  • Version: mergeOpenclawFrontmatter() / installOpenclaw() accept an explicit version override. bin/install.js's --only openclaw path now passes PINNED_REF (already bumped on every release for hook-integrity pinning β€” this reuses that existing, maintained value instead of introducing a second version source). SKILL_VERSION stays as the fallback for callers that don't pass one explicitly.
  • --no-always: new flag. Skips the always: true frontmatter stamp and the SOUL.md write; only the skill file is installed. Re-running --no-always over an already always-on install does not retroactively strip the existing SOUL.md block β€” it only changes what a new install does (covered by a test).

Before / after

- version: 1.0.0
+ version: 1.9.1
# new: install caveman for OpenClaw without forcing always-on
npx -y github:JuliusBrussee/caveman -- --only openclaw --no-always

Tests

4 new cases in tests/installer/e2e.freshinstall.test.mjs:

  • version threading (CAVEMAN_REF override β†’ frontmatter reflects it, not the fallback)
  • --no-always: skill written, versioned, no always: key, SOUL.md not created
  • --no-always idempotency: doesn't strip a SOUL.md block from a prior always-on install

Existing openclaw suite (always-on default, idempotent re-run, uninstall, marker damage-tolerance from #596) is unmodified and still green β€” confirms the default install path is unchanged.

npm test: 113/115 pass locally, including all 4 new tests. The 2 failures are pre-existing β€” they reproduce on an unmodified checkout of main in this sandbox, caused by a real claude CLI + ~/.openclaw present in the environment (tests documented as "skipped without claude CLI" detect it and take a different path). Unrelated to this change; not touched here.

Scope note

src/tools/caveman-init.js (the per-repo rule-file installer) also calls helper.installOpenclaw() for its openclaw target, and is left unchanged β€” it's a differently-scoped tool (drops rule files for many editors into a target repo, explicitly documented as installing an "always-on caveman rule") and extending it is a separate concern per the one-PR-one-concern guidance in CONTRIBUTING.md. Happy to follow up there if useful.

The OpenClaw installer (bin/lib/openclaw.js) hardcoded `SKILL_VERSION =
'1.0.0'` into every installed skill's frontmatter regardless of the actual
release, and unconditionally forced `always: true` with no way to opt out β€”
every OpenClaw install of caveman is permanently always-on with a fake
version stamp.

Fix both, scoped narrowly:

- version: mergeOpenclawFrontmatter()/installOpenclaw() now accept an
  explicit `version` override. bin/install.js's --only openclaw path passes
  its existing PINNED_REF (already bumped on each release for hook-integrity
  pinning β€” same value, new use) instead of relying on the static fallback.
  `openclaw skills list` now reports the release that was actually
  installed. SKILL_VERSION stays as the fallback for callers that don't pass
  one explicitly (src/tools/caveman-init.js, unchanged, out of scope here β€”
  see PR description).

- --no-always: new flag. Skips both the `always: true` frontmatter stamp and
  the SOUL.md bootstrap write, installing the skill as load-on-demand only
  (discoverable via `openclaw skills list`, per the module's own doc
  comment). Re-running --no-always over an existing always-on install does
  not retroactively strip the SOUL.md block β€” it only changes what a *new*
  install does.

Tests: 4 new cases in e2e.freshinstall.test.mjs covering the version
threading, the --no-always skill/SOUL.md split, and re-run idempotency.
Existing openclaw suite (always-on default, idempotency, uninstall, marker
damage-tolerance) unmodified and still green β€” default behavior is
unchanged.

npm test: 113/115 pass locally. The 2 failures are pre-existing and
reproduce on an unmodified checkout β€” they come from a real `claude` CLI +
`~/.openclaw` present in this sandbox interfering with tests documented as
"skipped without `claude` CLI"; unrelated to this change.
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