Skip to content

fix: add workspace skill root to skill-sync.ts (#410)#411

Merged
0xNyk merged 1 commit intobuilderz-labs:mainfrom
Brixyy:fix/skill-sync-missing-workspace-root
Mar 16, 2026
Merged

fix: add workspace skill root to skill-sync.ts (#410)#411
0xNyk merged 1 commit intobuilderz-labs:mainfrom
Brixyy:fix/skill-sync-missing-workspace-root

Conversation

@Brixyy
Copy link
Contributor

@Brixyy Brixyy commented Mar 16, 2026

Summary

  • Adds `workspace` root to `getSkillRoots()` (`src/lib/skill-sync.ts`): mirrors the root added to `route.ts` in feat: workspace skill root and root-based filtering in Skills Hub #408; the scheduler now discovers and syncs skills from `~/.openclaw/workspace/skills` (or `MC_SKILLS_WORKSPACE_DIR` / `OPENCLAW_WORKSPACE_DIR` overrides)
  • Adds `'workspace'` to `localSources` (`syncSkillsFromDisk()`): the DB query that checks for existing rows before upsert now includes the workspace source, preventing spurious re-inserts on every sync cycle
  • Updates doc comment from "Scans 4 skill roots" to "Scans 5 skill roots"

Closes #410

Test plan

  • Verified locally: placed skills with `SKILL.md` in `~/.openclaw/workspace/skills/`, triggered scheduler via `POST /api/scheduler` with `task_id=skill_sync` — skills appeared in DB and Skills Hub showed correct count (10 workspace skills)
  • Confirmed `~/.openclaw/workspace/skills` card updates from 0 → 10 after sync
  • `pnpm typecheck` — no errors
  • `pnpm test` — all pass
  • `pnpm lint` — no new warnings

skill-sync.ts had its own getSkillRoots() that was not updated when
PR builderz-labs#408 added the workspace root to route.ts. As a result the 60s
scheduler never scanned ~/.openclaw/workspace/skills and the source
was also missing from the localSources DB query, so workspace skills
could never be added to the DB and always showed 0 in the Skills Hub.

Closes builderz-labs#410
@Brixyy Brixyy requested a review from 0xNyk as a code owner March 16, 2026 12:45
Copy link
Member

@0xNyk 0xNyk left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Clean, surgical fix for the regression from #408. The workspace source was added to route.ts but missed in skill-sync.ts, so the scheduler sync never populated workspace skills.

LGTM — merging first so #413 can build on it.

@0xNyk 0xNyk merged commit b908c40 into builderz-labs:main Mar 16, 2026
1 check failed
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.

[Bug] skill-sync.ts missing workspace root — ~/.openclaw/workspace/skills always shows 0

2 participants