Skip to content

fix(cli): reject ClawHub-only flags for source skills - #128162

Merged
steipete merged 1 commit into
mainfrom
codex/autoqa-skill-source-options-20260823
Aug 23, 2026
Merged

steipete merged 1 commit into
mainfrom
codex/autoqa-skill-source-options-20260823

Conversation

@steipete

@steipete steipete commented Aug 23, 2026 •

Copy link
Copy Markdown
Contributor

What Problem This Solves

Fixes an issue where users installing a skill from Git or a local directory could pass --force-install or --acknowledge-clawhub-risk, see the install proceed, and reasonably assume those ClawHub scan/trust controls had taken effect even though the source installer ignored them.

Why This Change Was Made

The mixed-source skills install command now classifies all three ClawHub-only options at the existing source-dispatch boundary and rejects them before either installer runs. This extends the command's existing --version guard rather than adding a second parser path; ClawHub forwarding and source-owned --acknowledge-install-policy-warning behavior remain unchanged.

Production LOC: +10/-2 (net +8) | Tests: +13/-0. The production growth is the explicit parser/trust-boundary capability: identify each ClawHub-only option, preserve Commander casing compatibility for the acknowledgement flag, and return the exact rejected flag before mutation dispatch.

Best-fix verdict: This is the bounded owner-layer fix. Rejecting the flags in the source installer would be too late and would couple that lifecycle to CLI-only options; removing the shared options from the parser would also remove them from valid ClawHub installs.

Provenance: The mixed Git/local and ClawHub command was introduced in #84793, authored and self-merged by @Patrick-Erichsen on 2026-05-21. --force-install was later added in #90478, authored and self-merged by @Patrick-Erichsen on 2026-06-05, without extending the source-option rejection. --acknowledge-clawhub-risk was added in #81364, authored and self-merged by @jesse-merhi on 2026-06-26, with the same omission. No automation merger or automerge trigger was involved in those three landings.

User Impact

Git/local skill installs now fail fast with <flag> is only supported for ClawHub skill installs. when either ClawHub-only trust flag is supplied. Operators no longer receive a successful install after requesting a scan/risk control that did nothing. This intentionally rejects previously accepted-but-ineffective invocations so the command matches its documented trust boundary.

Evidence

  • Pre-fix regression proof: the new table failed for all four Git/local × flag cases while the existing suite remained green: 90 passed, 4 failed.
  • Focused owner suites: node scripts/run-vitest.mjs src/cli/skills-cli.commands.test.ts src/cli/skills-cli.test.ts → 123/123 passed.
  • Changed-file gate: node scripts/check-changed.mjs -- src/cli/skills-cli.ts src/cli/skills-cli.commands.test.ts passed production/test typechecks, lint, formatting, dead-code, import-cycle, database-first, and repository guards.
  • Build: pnpm build passed on the final source.
  • Real CLI: the source runner rejected a local install with --force-install at exit 1; the built CLI rejected a local install with --acknowledge-clawhub-risk at exit 1. Both emitted the expected flag-specific diagnostic, and neither published a skill under the isolated temporary workspace.
  • Commander contract: pinned Commander 15.0.0 implements Option.attributeName() with kebab-to-camel conversion in node_modules/commander/lib/option.js; a direct parser probe produced {"acknowledgeClawhubRisk":true,"forceInstall":true} and reported the exact option keys acknowledgeClawhubRisk / forceInstall.
  • Independent review: final branch autoreview completed cleanly at 0.99 confidence with no accepted/actionable findings. ClawSweeper independently reported no findings and passed a real CLI rejection run on the exact head.
  • Exact-head CI: run 32629618354 completed green at 4bb438cc134b1645ed0a1046b2eb6c45206a3c60, including openclaw/ci-gate and all selected core shards.
  • git diff --check passed.

AI-assisted: yes. I understand and reviewed the command dispatch, installer boundaries, regression coverage, dependency option-key contract, and validation above. No agent transcript is attached.

@clawsweeper

clawsweeper Bot commented Aug 23, 2026

Copy link
Copy Markdown
Contributor

🦞👀
ClawSweeper picked this up.

Pull request received. I will update this pull request when review starts.

@openclaw-barnacle openclaw-barnacle Bot added cli CLI command changes size: XS maintainer Maintainer-authored PR labels Aug 23, 2026
@steipete
steipete marked this pull request as ready for review August 23, 2026 08:56
@clawsweeper clawsweeper Bot added merge-risk: 🚨 compatibility 🚨 May break existing users, config, migrations, defaults, or upgrade paths. P2 Normal backlog priority with limited blast radius. rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR. labels Aug 23, 2026
@clawsweeper

clawsweeper Bot commented Aug 23, 2026 •

Copy link
Copy Markdown
Contributor

Codex review: needs maintainer review before merge. Reviewed August 23, 2026, 5:19 AM ET / 09:19 UTC.

ClawSweeper review

What this changes

The PR rejects ClawHub-only version, pending-scan, and risk-acknowledgement flags before Git or local skill installers run.

Regression provenance

Possible regression — suspected (reviewed change). No predecessor PR is attributed.

Merge readiness

⚠️ Ready for maintainer review - 4 items remain

Keep open for maintainer acceptance of the intentional CLI compatibility change. The source-dispatch guard is a focused, correct fix for flags that previously had no effect on Git/local installs.

Priority: P2
Reviewed head: 4bb438cc134b1645ed0a1046b2eb6c45206a3c60
Owner decision: Required. See Decision needed.

Review scores

Measure Result What it means
Overall readiness 🐚 platinum hermit (4/6) The focused parser-boundary repair has matching regression coverage and reported terminal evidence, with one intentional compatibility decision remaining.
Proof confidence 🐚 platinum hermit (4/6) Not applicable: The PR is maintainer-authored; its body additionally reports after-fix source-run and built-CLI terminal checks.
Patch quality 🐚 platinum hermit (4/6) No actionable review findings were identified.

Verification

Check Result Evidence
Real behavior Not applicable Not applicable: The PR is maintainer-authored; its body additionally reports after-fix source-run and built-CLI terminal checks.
Evidence reviewed 5 items Current-main gap: Current main rejects only --version for a source reference and then calls the source installer, so --force-install and --acknowledge-clawhub-risk can reach Git/local installation without being consumed.
Owner-boundary separation: The source installer accepts only overwrite and install-policy-warning controls, while the ClawHub installer owns force-install and risk-acknowledgement parameters.
Documented contract: The skills documentation describes Git/local installs as unmanaged and identifies --force-install and risk acknowledgement as ClawHub scan/trust controls.
Findings None None.
Security None None.

Live Verification

Command: pnpm openclaw skills install ./skills/weather --force-install

Result: FAIL (failed) — execution before step 1 run: live-proof package manager pnpm is unavailable after its official installer (curl -fsSL https://get.pnpm.io/install.sh | sh -): command failed without output

live-proof package manager pnpm is unavailable after its official installer (curl -fsSL https://get.pnpm.io/install.sh | sh -): command failed without output

Assertions:

  • FAIL expect_output: --force-install is only supported for ClawHub skill installs.

How this fits together

The skills CLI accepts ClawHub, Git, and local-directory install references through one command. It classifies the reference before handing it to either the ClawHub installer with trust controls or the source installer with local policy controls.

flowchart LR
  A[Operator command] --> B[Skills install CLI]
  B --> C{Reference type}
  C --> D[Source flag check]
  D -->|Git or local| E[Source installer]
  D -->|Unsupported flag| F[Clear exit-1 error]
  C -->|ClawHub| G[ClawHub trust installer]
  E --> H[Workspace skill]
  G --> H
Loading

Decision needed

Question Recommendation
Should this PR intentionally change Git/local skill installs from silently ignoring ClawHub-only flags to failing fast? Accept documented fail-fast behavior: Merge the guard so unsupported flags produce a clear error before a Git or local installer can mutate the workspace.

Why: This is a deliberate compatibility change for existing scripts, so code review cannot choose the upgrade policy on maintainers’ behalf.

Before merge

  • Resolve merge risk (P1) - Existing Git or local install scripts that supplied previously ignored ClawHub-only flags will now exit 1; documentation supports the fail-fast interpretation, but maintainers must consciously accept that compatibility change.
  • Resolve merge risk (P1) - Production code grows by eight net lines; the explicit three-flag mapping is clearer than a nested conditional or one-use helper, so no net-neutral formulation appears to improve the owner boundary.
  • Complete next step (P2) - A maintainer must accept the deliberate compatibility change; no mechanical repair remains.
Agent review details

Security

None.

PR surface

Source +8, Tests +13. Total +21 across 2 files.

View PR surface stats
Area Files Added Removed Net
Source 1 10 2 +8
Tests 1 13 0 +13
Docs 0 0 0 0
Config 0 0 0 0
Generated 0 0 0 0
Other 0 0 0 0
Total 2 23 2 +21

Review metrics

Metric Value Why it matters
Production versus regression coverage production +10/-2 (net +8); tests +13/-0 The production delta centralizes three source-invalid options, while the added table covers four Git/local rejection cases.
Existing option scope 2 existing flags newly rejected for 2 source kinds The behavioral change affects scripts using --force-install or --acknowledge-clawhub-risk with Git or local references.

Merge-risk options

Maintainer options:

  1. Accept the fail-fast contract (recommended)
    Merge after accepting that Git/local scripts passing ignored ClawHub-only flags will now stop with a specific diagnostic.
  2. Keep no-op compatibility
    Do not merge this behavior change if those scripts must continue despite the flags never affecting source installs.

Technical review

Best possible solution:

Retain one explicit pre-dispatch guard for all three ClawHub-only flags, preserving valid ClawHub installs while preventing a source install from implying trust controls ran.

Do we have a high-confidence way to reproduce the issue?

Yes—current main’s source branch forwards Git/local installs after checking only --version, while the source installer has no parameters for the two remaining ClawHub controls. This read-only review did not execute the CLI, but the PR supplies parser-boundary regression coverage and reported CLI runs.

Is this the best way to solve the issue?

Yes—the shared dispatcher is the correct owner because it knows the reference kind before either installer runs; rejecting inside the source installer would be later and would couple it to ClawHub-only CLI controls.

AGENTS.md: found and applied where relevant.

Codex review notes: model internal, reasoning high; reviewed against 3cb52f4bb869.

Labels

Label justifications:

  • P2: This fixes misleading behavior in a bounded CLI skill-install workflow.
  • merge-risk: 🚨 compatibility: Existing Git/local automation that passed previously ignored flags will now receive a non-zero exit.
  • rating: 🐚 platinum hermit: Overall readiness is 🐚 platinum hermit; proof is 🐚 platinum hermit and patch quality is 🐚 platinum hermit.
  • status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR. Not applicable: The PR is maintainer-authored; its body additionally reports after-fix source-run and built-CLI terminal checks.

Evidence

What I checked:

  • Current-main gap: Current main rejects only --version for a source reference and then calls the source installer, so --force-install and --acknowledge-clawhub-risk can reach Git/local installation without being consumed. (src/cli/skills-cli.ts:688, 3cb52f4bb869)
  • Owner-boundary separation: The source installer accepts only overwrite and install-policy-warning controls, while the ClawHub installer owns force-install and risk-acknowledgement parameters. (src/skills/lifecycle/source-install.ts:409, 4bb438cc134b)
  • Documented contract: The skills documentation describes Git/local installs as unmanaged and identifies --force-install and risk acknowledgement as ClawHub scan/trust controls. Public docs: docs/cli/skills.md. (docs/cli/skills.md:97, 4bb438cc134b)
  • Regression coverage: The added parser-boundary table covers both Git and local references for each newly rejected flag and asserts that neither installer is invoked. (src/cli/skills-cli.commands.test.ts:815, 4bb438cc134b)
  • History provenance: Blame shows the current-main source branch previously contained only the --version rejection; this PR expands that same decision point rather than adding a second parser path. (src/cli/skills-cli.ts:689, d75164c46d43)

Likely related people:

  • Patrick-Erichsen: Related merged work introduced Git/local skill installs and the ClawHub pending-scan option that this shared dispatcher must distinguish. (role: source-install and pending-scan feature contributor; confidence: high; commits: c0312748c4f7, 8f85f949465a; files: src/cli/skills-cli.ts, src/skills/lifecycle/source-install.ts)
  • jesse-merhi: Related merged trust work introduced the acknowledgement control whose scope this PR now makes explicit. (role: ClawHub trust-control contributor; confidence: high; commits: ec737ee74d9b; files: src/cli/skills-cli.ts, src/skills/lifecycle/clawhub-install-core.ts)

Rank-up moves

Optional improvements that raise the rating; they are not merge blockers.

  • Record maintainer acceptance of the fail-fast compatibility change before merge.

Rating scale

Score Internal tier Crab rank Meaning
6/6 S 🦀 challenger crab Exceptional readiness
5/6 A 🦞 diamond lobster Very strong readiness
4/6 B 🐚 platinum hermit Good normal PR; ordinary maintainer review
3/6 C 🦐 gold shrimp Useful, but confidence is limited
2/6 D 🦪 silver shellfish Proof or implementation needs work
1/6 F 🧂 unranked krab Not merge-ready
N/A NA 🌊 off-meta tidepool Rating does not apply

Overall follows the weaker of proof and patch quality.
Shiny media proof means a screenshot, video, or linked artifact directly shows the changed behavior. Runtime, network, CSP, and security claims still need visible diagnostics.

Workflow

  • ClawSweeper keeps one durable marker-backed review comment per issue or PR.
  • Re-runs edit this comment so the latest verdict, findings, and automation markers stay together instead of adding duplicate bot comments.
  • A fresh review can be triggered by eligible @clawsweeper re-review comments, exact-item GitHub events, scheduled/background review runs, or manual workflow dispatch.
  • PR/issue authors and users with repository write access can comment @clawsweeper re-review or @clawsweeper re-run on an open PR or issue to request a fresh review only.
  • Maintainers can also comment @clawsweeper review to request a fresh review only.
  • Fresh-review commands do not start repair, autofix, rebase, CI repair, or automerge.
  • Maintainer-only repair and merge flows require explicit commands such as @clawsweeper autofix, @clawsweeper automerge, @clawsweeper fix ci, or @clawsweeper address review.
  • Maintainers can comment @clawsweeper explain to ask for more context, or @clawsweeper stop to stop active automation.

History

Review history (1 earlier review cycle)
  • reviewed 2026-08-23T09:03:25.894Z sha 4bb438c :: needs maintainer review before merge. :: none

Copy link
Copy Markdown
Contributor Author

Maintainer decision and land-ready evidence for exact head 4bb438cc134b1645ed0a1046b2eb6c45206a3c60:

  • Compatibility decision: accept the intentional fail-fast change. A Git/local invocation that supplied a ClawHub-only trust control previously succeeded while the control had no effect; rejecting it before mutation is the documented and truthful contract.
  • Production growth: accept +8 net production lines. The added code keeps one dispatch boundary, identifies all three ClawHub-only option states, and emits the exact rejected flag. Moving this into the source installer would leak CLI policy into the lifecycle owner; removing the shared options would break valid ClawHub installs.
  • Commander dependency contract: inspected pinned Commander 15.0.0 directly. Option.attributeName() uses kebab-to-camel conversion; an executable parser probe returned {"acknowledgeClawhubRisk":true,"forceInstall":true} and the exact keys acknowledgeClawhubRisk / forceInstall.
  • Behavior proof: pre-fix owner suite had 90 passes plus the four intended Git/local × flag failures; final owner suites are 123/123. Source and built CLI probes both exited 1 with exact diagnostics and no skill publication. ClawSweeper independently passed a real CLI rejection run and reported no findings.
  • Exact-head gates: CI run 32629618354, CodeQL, dependency/security guards, and OpenGrep are green. Fresh autoreview is clean at 0.99 confidence. Repo-native review artifacts validate as READY FOR /prepare-pr with zero findings.

All actionable/rank-up evidence is resolved. Proceeding to the mandatory hosted Testbox prepare gate; the later duplicate ClawSweeper shard is rating refresh only and does not supersede the completed exact-head review.

Copy link
Copy Markdown
Contributor Author

Hosted prepare completed successfully for exact head 4bb438cc134b1645ed0a1046b2eb6c45206a3c60.

OPENCLAW_TESTBOX=1 scripts/pr prepare-run 128162
hosted CI/Testbox gates passed
GATES_MODE=hosted_exact_or_recent_parent
HOSTED_GATES_TARGET_HEAD_SHA=4bb438cc134b1645ed0a1046b2eb6c45206a3c60
GATES_PASSED_AT=2026-08-23T09:24:07Z
prepare-run complete for PR #128162

The native workflow reused the fully green exact-head hosted gate (CI run 32629618354), verified the remote PR tree equals the local prepared tree, required no changelog, and made no head change or rebase. Prepared and PR head remain byte-identical at 4bb438cc….

@steipete
steipete merged commit 2107d1e into main Aug 23, 2026
247 checks passed
@steipete
steipete deleted the codex/autoqa-skill-source-options-20260823 branch August 23, 2026 09:28

Copy link
Copy Markdown
Contributor Author

Merged via squash.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

cli CLI command changes maintainer Maintainer-authored PR merge-risk: 🚨 compatibility 🚨 May break existing users, config, migrations, defaults, or upgrade paths. P2 Normal backlog priority with limited blast radius. rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. size: XS status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants