fix(openclaw): stop stamping stale version, add --no-always opt-out - #720
Open
pierrz wants to merge 1 commit into
Open
fix(openclaw): stop stamping stale version, add --no-always opt-out#720pierrz wants to merge 1 commit into
pierrz wants to merge 1 commit into
Conversation
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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
Found while integrating caveman into an OpenClaw deployment and reading
bin/lib/openclaw.js: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 listreports a version that's never been accurate since the constant was introduced.installOpenclaw()unconditionally stampsalways: trueand 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:
mergeOpenclawFrontmatter()/installOpenclaw()accept an explicitversionoverride.bin/install.js's--only openclawpath now passesPINNED_REF(already bumped on every release for hook-integrity pinning β this reuses that existing, maintained value instead of introducing a second version source).SKILL_VERSIONstays as the fallback for callers that don't pass one explicitly.--no-always: new flag. Skips thealways: truefrontmatter stamp and the SOUL.md write; only the skill file is installed. Re-running--no-alwaysover 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
# new: install caveman for OpenClaw without forcing always-on npx -y github:JuliusBrussee/caveman -- --only openclaw --no-alwaysTests
4 new cases in
tests/installer/e2e.freshinstall.test.mjs:CAVEMAN_REFoverride β frontmatter reflects it, not the fallback)--no-always: skill written, versioned, noalways:key, SOUL.md not created--no-alwaysidempotency: doesn't strip a SOUL.md block from a prior always-on installExisting 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 ofmainin this sandbox, caused by a realclaudeCLI +~/.openclawpresent in the environment (tests documented as "skipped withoutclaudeCLI" 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 callshelper.installOpenclaw()for itsopenclawtarget, 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.