Skip to content

fix(onboard): preserve the saved skills package manager - #130438

Merged
steipete merged 1 commit into
mainfrom
codex/onboarding-preserve-skill-node-manager
Aug 26, 2026
Merged

steipete merged 1 commit into
mainfrom
codex/onboarding-preserve-skill-node-manager

Conversation

@steipete

@steipete steipete commented Aug 26, 2026 •

Copy link
Copy Markdown
Contributor

Closes #130433

What Problem This Solves

Fixes an issue where operators rerunning non-interactive onboarding would silently lose a saved pnpm, Bun, or Yarn skill-install preference when they did not pass --node-manager. Interactive skills setup also replaced a valid saved Yarn preference with npm, affecting classic onboarding, configure, and hosted skills setup.

Why This Change Was Made

Both existing setup owners now resolve explicit CLI choice, then saved configuration, then npm. Validation applies to explicitly supplied CLI choices; the persisted config contract is intentionally wider because it also supports Yarn. No new helper, dependency, setting, migration, or installer-policy change is needed.

The removed path is the interactive resolver's redundant three-value filter on already-validated persisted configuration. CLI validation still accepts only npm, pnpm, and Bun, and --skip-skills leaves existing settings untouched.

User Impact

Setup no longer silently changes which package manager subsequent skill installs use. Existing preferences survive, explicit overrides still win, and fresh configurations still default to npm. The skills configuration reference now states this precedence.

Evidence

  • Four regression cases failed on unchanged main production code: non-interactive saved pnpm/Bun/Yarn, and interactive saved Yarn at the installer handoff. All 160 tests across six owner/orchestration suites passed after the fix, including fresh defaults, explicit overrides, and skipping skills.
  • Actual pure owner invocation reproduced pnpm/Bun/Yarn becoming npm before the patch and preserving each value afterward.
  • Independent source/caller/config/installer review: no actionable findings. Fresh Codex autoreview: clean. Configured oxlint, oxfmt, and git diff --check: passed.
  • Production LOC: +5/-6 (net -1). Tests: +82/-25 (net +57). Docs: +2/-1.
  • Built CLI before/after proof passed in isolated temporary homes and state directories. Current main 99a2434f7b89c682f934326be9f7cc786f7ddeca reset saved pnpm/Bun/Yarn to npm with exit 0. Exact PR head 541dc3bba62b99ea85917b3bd6364556e198f256 preserved npm/pnpm/Bun/Yarn, defaulted fresh config to npm, and honored explicit npm/pnpm/Bun overrides: all eight cases exited 0 with the expected persisted value and unrelated preferBrew: false retained.
  • Both baseline and candidate passed node --import tsx scripts/build-all.mts cliStartup with frozen worktree-local dependencies. The candidate build included CLI bootstrap import validation and 48 built plugin-control-plane load checks.
  • The 160-test focused suite also passed again with the fresh native-worktree dependencies. The broad local changed check passed formatting, production types, ratchets, dependency/boundary guards and all dead-export scans, then stopped on two unrelated gateway test-type errors. Running the exact gateway-other typecheck on the unmodified base d916808353e42b419c3fd5ec9ed5739c26eacbcf reproduces both errors unchanged (sessions-mutations.sticky-model.test.ts:216,245, assigning the readonly model property). This is recorded as a separate gateway test-fixture follow-up, not treated as a passing full changed check.
  • Exact-head hosted CI completed successfully on 541dc3bba62b99ea85917b3bd6364556e198f256; required openclaw/ci-gate is SUCCESS. The focused commands test-type graph and configured changed-file oxlint also passed with the fresh PR-owned dependencies.

The same defect exists in stable tag v2026.7.1-2. Local blame stops at a shallow-history boundary, so the original introducing author/PR is unknown and that boundary is not attributed as the introduction.

Earlier shared-install build attempts encountered existing checkout dependency issues (missing worktree dependency roots, then an installed TUI dependency lacking TuiMainScreen). Installing frozen dependencies in the native PR-owned checkout resolved these without changing product code. A remote changed-gate upload timed out before tests ran; its Blacksmith test machine was stopped and verified completed. Local gate results are recorded above.

The latest ClawSweeper review on this exact head has no actionable code, test, documentation or security findings. Its rank-up move, finishing exact-head CI and focused onboarding validation, is complete. Independent maintainer review and fresh Codex autoreview are also complete; landing uses the native prepare/merge flow.

The CLI proof runs node openclaw.mjs onboard --non-interactive --accept-risk --auth-choice skip --skip-health --skip-hooks --skip-bootstrap --skip-channels --skip-search --skip-ui --no-install-daemon --json, with optional --node-manager overrides, against isolated config seeded with each saved manager. State is created by scripts/lib/openclaw-test-state.mts create --scenario minimal; only the expected manager result is reported, and each temporary root is removed afterward. No daemon, real provider, external package installation, or live user state is involved.

AI-assisted maintainer repair. No credentials, live user configuration, or running Gateway were changed.

Keep explicit CLI choice precedence while preserving existing pnpm, Bun, and Yarn preferences when onboarding is rerun. Retain npm defaults for fresh config and the narrower explicit CLI choices. Fixes #130433.
@clawsweeper

clawsweeper Bot commented Aug 26, 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 docs Improvements or additions to documentation r: skill Auto-close: skills should be published on ClawHub, not added to core. commands Command implementations size: S maintainer Maintainer-authored PR labels Aug 26, 2026
@steipete
steipete marked this pull request as ready for review August 26, 2026 21:52
@steipete steipete closed this Aug 26, 2026
@steipete steipete reopened this Aug 26, 2026
@clawsweeper clawsweeper Bot added P1 High-priority user-facing bug, regression, or broken workflow. 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 26, 2026
@clawsweeper

clawsweeper Bot commented Aug 26, 2026

Copy link
Copy Markdown
Contributor

Codex review: needs maintainer review before merge. Reviewed August 26, 2026, 6:00 PM ET / 22:00 UTC.

ClawSweeper review

What this changes

The PR preserves a saved skills package-manager preference during interactive and non-interactive onboarding unless a valid --node-manager override is supplied.

Regression provenance

Possible regression — probable (reproduction; reviewed change). No predecessor PR is attributed.

Merge readiness

⚠️ Ready for maintainer review - 2 items remain

Keep this maintainer-owned PR open for normal merge review. The patch repairs both configuration-selection owners with the documented explicit CLI > saved setting > npm precedence; no blocking code, test, documentation, or security finding was found.

Priority: P1
Reviewed head: 541dc3bba62b99ea85917b3bd6364556e198f256

Review scores

Measure Result What it means
Overall readiness 🐚 platinum hermit (4/6) A focused, net-negative owner-boundary repair with useful regressions; exact-head validation remains before merge.
Proof confidence 🌊 off-meta tidepool Not applicable: This maintainer-authored PR is exempt from the external-contributor real-behavior-proof gate; its stated owner-level reproduction is consistent with the inspected source.
Patch quality 🐚 platinum hermit (4/6) No actionable review findings were identified.

Verification

Check Result Evidence
Real behavior Not applicable Not applicable: This maintainer-authored PR is exempt from the external-contributor real-behavior-proof gate; its stated owner-level reproduction is consistent with the inspected source.
Evidence reviewed 6 items Non-interactive owner fix: Current main defaults an omitted CLI value to npm before merging configuration; the PR instead validates only an explicit value and uses explicit > saved > npm.
Interactive owner and callers: The interactive resolver now retains the persisted manager; classic setup, configure, and hosted setup all call this shared owner before its resulting config is passed to skill installation.
Persisted-config and installer contract: The schema permits npm, pnpm, yarn, and bun, and downstream skill installation explicitly maps Yarn to yarn global add; CLI validation remains intentionally narrower.
Findings None None.
Security None None.

Live Verification

Command: pnpm test src/commands/onboard-non-interactive/local/skills-config.test.ts src/commands/onboard-skills.test.ts

Result: PASS (completed)

$ node --import tsx scripts/test-projects.mts src/commands/onboard-non-interactive/local/skills-config.test.ts src/commands/onboard-skills.test.ts
[test] starting test/vitest/vitest.commands.config.ts

 RUN  v4.1.11 /tmp/clawsweeper-live-proof-130438-qULoEW/target

 ✓  commands  src/commands/onboard-skills.test.ts (23 tests) 83ms
 ✓  commands  src/commands/onboard-non-interactive/local/skills-config.test.ts (9 tests) 2ms

 Test Files  2 passed (2)
      Tests  32 passed (32)
   Start at  22:01:02
   Duration  1.16s (transform 915ms, setup 736ms, import 103ms, tests 85ms, environment 0ms)

[test] passed 1 Vitest shard in 5.23s
$ node --import tsx scripts/test-projects.mts src/commands/onboard-non-interactive/local/skills-config.test.ts src/commands/onboard-skills.test.ts
[test] starting test/vitest/vitest.commands.config.ts

 RUN  v4.1.11 /tmp/clawsweeper-live-proof-130438-qULoEW/target

 ✓  commands  src/commands/onboard-skills.test.ts (23 tests) 52ms
 ✓  commands  src/commands/onboard-non-interactive/local/skills-config.test.ts (9 tests) 2ms

 Test Files  2 passed (2)
      Tests  32 passed (32)
   Start at  22:01:07
   Duration  584ms (transform 294ms, setup 352ms, import 35ms, tests 54ms, environment 0ms)

[test] passed 1 Vitest shard in 4.51s

Assertions:

  • PASS expect_output: Test Files

How this fits together

Onboarding combines an optional CLI package-manager choice with saved skills configuration before writing setup state and invoking selected skill installers. The selected value controls later Node-based skill installation commands.

flowchart LR
  A[Saved skills configuration] --> C[Onboarding selection]
  B[CLI node-manager option] --> C
  C --> D[Validate explicit choice]
  D --> E[Explicit, saved, or npm]
  E --> F[Persisted configuration]
  E --> G[Skill installer]
Loading

Before merge

  • Resolve merge risk (P1) - Exact-head CI is still incomplete, so merge should wait for its required checks and focused onboarding validation to finish.
  • Complete next step (P2) - This protected maintainer PR has no mechanical repair finding; complete exact-head CI and normal maintainer merge review.
Agent review details

Security

None.

PR surface

Source -1, Tests +57, Docs +1. Total +57 across 5 files.

View PR surface stats
Area Files Added Removed Net
Source 2 5 6 -1
Tests 2 82 25 +57
Docs 1 2 1 +1
Config 0 0 0 0
Generated 0 0 0 0
Other 0 0 0 0
Total 5 89 32 +57

Review metrics

Metric Value Why it matters
Production versus regression coverage production +5/-6 (net -1); tests +82/-25 (net +57); docs +2/-1 (net +1) The repair remains net-negative in production while adding owner-boundary regressions for both setup paths.
Persisted-setting behavior 1 existing setting precedence changed; 0 flags, schema values, migrations, or dependencies added The change restores the documented Yarn-capable saved-config contract without expanding the public CLI surface.

Root-cause cluster

Relationship: fixed_by_candidate
Canonical: #130433
Summary: This PR is the candidate repair for the linked onboarding preference-reset bug.

Members:

Proposal only: this assessment does not dispatch repair, suppress jobs, mutate sibling items, close, or merge anything.

Merge-risk options

Maintainer options:

  1. Decide the mitigation before merge
    Retain one canonical precedence rule—explicit CLI choice, then valid saved setting, then npm—and merge after exact-head validation confirms it across setup entry points.
  2. Pause or close
    Do not merge this PR until maintainers decide whether the risk is worth taking.

Technical review

Best possible solution:

Retain one canonical precedence rule—explicit CLI choice, then valid saved setting, then npm—and merge after exact-head validation confirms it across setup entry points.

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

Yes—source establishes a deterministic path: start with a saved manager, omit --node-manager, and invoke either setup owner; current main selects npm while this PR preserves the saved value. The review was read-only, so it did not execute that reproduction.

Is this the best way to solve the issue?

Yes—the change fixes selection at both owners rather than compensating in installers, while preserving the existing narrower CLI contract and fresh-config npm default.

AGENTS.md: found and applied where relevant.

Codex review notes: model internal, reasoning high; reviewed against 99a2434f7b89.

Labels

Label changes:

  • add P1: The current shipped behavior can silently replace an operator’s saved package-manager choice during onboarding.
  • add rating: 🐚 platinum hermit: Overall readiness is 🐚 platinum hermit; proof is 🌊 off-meta tidepool and patch quality is 🐚 platinum hermit.
  • add status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR. Not applicable: This maintainer-authored PR is exempt from the external-contributor real-behavior-proof gate; its stated owner-level reproduction is consistent with the inspected source.

Label justifications:

  • P1: The current shipped behavior can silently replace an operator’s saved package-manager choice during onboarding.
  • rating: 🐚 platinum hermit: Overall readiness is 🐚 platinum hermit; proof is 🌊 off-meta tidepool and patch quality is 🐚 platinum hermit.
  • status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR. Not applicable: This maintainer-authored PR is exempt from the external-contributor real-behavior-proof gate; its stated owner-level reproduction is consistent with the inspected source.

Evidence

What I checked:

Likely related people:

  • steipete: The shallow-boundary blame for both pre-fix owner blocks and the PR head identify this person on the current implementation trail; earlier provenance is unavailable. (role: recent area contributor and repair author; confidence: medium; commits: d9b41332e458, 541dc3bba62b; files: src/commands/onboard-non-interactive/local/skills-config.ts, src/commands/onboard-skills.ts)

Rank-up moves

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

  • Complete the required exact-head CI and focused onboarding validation before merging.

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.

@steipete
steipete merged commit b10beee into main Aug 26, 2026
329 of 376 checks passed
@steipete
steipete deleted the codex/onboarding-preserve-skill-node-manager branch August 26, 2026 22:18
@steipete

Copy link
Copy Markdown
Contributor Author

Merged via squash.

@steipete

Copy link
Copy Markdown
Contributor Author

Post-landing verification: b10beeee7c24 is on current main; all five changed files match the verified source head, and #130433 is closed. The checkout is clean and the temporary proof worktrees are removed.

Separate maintainer-tooling follow-up: native merge-run completed the merge and posted its completion comment, then failed to release its operation lock after deleting the worktree containing its current directory (getcwd failure). No merge tools remained; recovery used the exact emitted owner token from a persistent checkout. The lock is cleared. This was post-merge cleanup, not a bypass of validation or required checks.

vincentkoc added a commit that referenced this pull request Aug 26, 2026
* origin/main: (275 commits)
  fix(ai): require explicit compatible-provider endpoints (#130453)
  test(control-ui): guard the hand-mirrored theme --bg copies (#130444)
  fix(onboard): preserve the saved skills package manager (#130438)
  improve(worker): diagnose admission-deadline failures and widen daemon revalidation budget (#130435)
  fix(plugins): align diffs external install metadata (#130362)
  refactor(models): consolidate config normalization (#130439)
  fix(browser): accept common keyboard aliases (#130401)
  fix(release): refresh IMAP plugin baselines (#130351)
  fix(tests): type sticky model agent fixtures (#130441)
  fix(qa): track current Slack progress cards (#130354)
  feat(ui): refine the mobile composer (#130308)
  fix(ui): clarify gateway disconnect status in tab title (#130364)
  test(qa): await gateway startup before network probes (#130353)
  fix(qa): run Buzz profile scenarios with pooled credentials (#130316)
  fix(crabbox): keep the setup failure reason and name its phase (#130425)
  fix: dashboard tools target the wrong Gateway after admission (#130112)
  fix(ui): distinguish inherited model defaults from session pins (#120805)
  feat(feishu): let agents resend received stickers (#130374)
  refactor(models): prepare selection policy once (#130413)
  fix(ui): make dashboard side panels enter split view (#130426)
  ...

# Conflicts:
#	test/scripts/docker-build-helper.test.ts
github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Aug 27, 2026
)

Keep explicit CLI choice precedence while preserving existing pnpm, Bun, and Yarn preferences when onboarding is rerun. Retain npm defaults for fresh config and the narrower explicit CLI choices. Fixes openclaw#130433.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

commands Command implementations docs Improvements or additions to documentation maintainer Maintainer-authored PR P1 High-priority user-facing bug, regression, or broken workflow. r: skill Auto-close: skills should be published on ClawHub, not added to core. rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. size: S 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.

Onboarding resets the saved skills package manager to npm

1 participant