fix(skills): detect built-in skills from all npm install layouts#11
Merged
Conversation
The skills:list IPC handler and skill-integrity.getSkillSourceDirs() only probed ~/.openclaw-node/{,lib/}node_modules/openclaw/skills, the legacy deployer layout. When the installer reuses a system Node.js and runs
pm i -g openclaw, the package lands under %AppData%/npm/node_modules/openclaw (or %ProgramFiles%/nodejs/... for per-machine installs), so the Settings -> Skill Management panel showed Built-in Skills (0) even though resolveOpenClawEntry() found the package and the gateway loaded all 52 skills correctly.
Add resolveBuiltinSkillsDir() in path-resolver.ts that mirrors the candidate list used by resolveOpenClawEntry() (packaged resources, ~/.openclaw-node classic+lib, %AppData%/npm, %ProgramFiles%/nodejs, %LocalAppData%/Programs/nodejs) and route both call sites through it. Tests updated to mock the new helper.
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
Settings → Skill Management showed
Built-in Skills (0)— "No built-in skills detected" even though the gateway was happily loading all 52 skills and chats worked fine.Root cause: the
skills:listIPC handler indesktop/src/main.tsandgetSkillSourceDirs()indesktop/src/skill-integrity.tshard-coded the built-in skills directory to only two paths — the legacy deployer layout under~/.openclaw-node/:Per the updated install flow described in
CLAUDE.md, the deployer now installs Node.js via the official MSI to%ProgramFiles%\nodejs\(or reuses a system Node ≥22.16), andopenclawis installed vianpm i -g, which lands the package in:%AppData%\npm\node_modules\openclaw\skills(per-user npm prefix — default on Windows)%ProgramFiles%\nodejs\node_modules\openclaw\skills(per-machine)%LocalAppData%\Programs\nodejs\node_modules\openclaw\skills(per-user Node)None of these were probed by the UI's skill-listing code, so the panel rendered empty.
Notably
resolveOpenClawEntry()inpath-resolver.tsalready handled the%AppData%\npmlayout — which is why the gateway foundopenclaw.mjsand ran normally; only the UI list was blind.Fix
Add a shared
resolveBuiltinSkillsDir()helper indesktop/src/path-resolver.tsthat mirrors the candidate list used byresolveOpenClawEntry():process.resourcesPath/openclaw/skills)~/.openclaw-node/node_modules/openclaw/skills(classic deployer)~/.openclaw-node/lib/node_modules/openclaw/skills(lib deployer)%AppData%/npm/node_modules/openclaw/skills(per-user npm global)%ProgramFiles%/nodejs/node_modules/openclaw/skills(per-machine Node)%LocalAppData%/Programs/nodejs/node_modules/openclaw/skills(per-user Node)Returns the first existing path, falling back to candidate #2 (legacy layout) so log messages stay informative when nothing is installed yet.
Both call sites —
skills:listinmain.tsandgetSkillSourceDirs()inskill-integrity.ts— now route through this helper.Verification
path-resolver.test.ts+skill-integrity.test.tspass.skill-integrity.test.tsto also mockresolveBuiltinSkillsDir.npm run devconfirms the file-watcher picks up the right directory:Files changed
desktop/src/path-resolver.ts— newresolveBuiltinSkillsDir()desktop/src/main.ts—skills:listuses the helperdesktop/src/skill-integrity.ts—getSkillSourceDirs()uses the helperdesktop/src/skill-integrity.test.ts— mock updated