fix(core): reload changed skill sources - #40954
Open
kitlangton wants to merge 3 commits into
Open
Conversation
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.
What
Hot reload local skill directory sources, including global and explicitly configured sources outside the active project.
Skill additions, edits, removals, and symlink target changes now invalidate the affected cached catalog and publish
skill.updatedwithout restarting the service or evicting the location.Before / After
Before
~/.config/opencode/skillsor another external source.After
Skillestablishes source-owned watches before scanning a directory.skill.updated.How
packages/core/src/skill.tsfollows the existing plugin watcher pattern: a local watch-once set plus the sharedWatcher.subscribeservice.RcMap.skill.updatedread barrier.Scope
Testing
bun run test test/skill.test.ts test/filesystem/watcher.test.tsfrompackages/core(22 passed)OPENCODE_CONFIG_DIR=/private/var/folders/dd/5fz89drs5p9_r0fk7rwqqnbr0000gn/T/opencode/empty-config bun run testfrompackages/core(1,554 passed, 7 skipped)bun typecheckfrompackages/corebun turbo typecheck --concurrency=3(32 packages passed)git diff --checkFlow
sequenceDiagram participant Config as Skill source participant Skill as Skill service participant Watcher as Shared watcher participant Client as TUI/client Skill->>Watcher: subscribe to source Skill->>Config: scan and cache skills Config-->>Watcher: file added, changed, or removed Watcher->>Skill: filesystem update Skill->>Skill: invalidate matching cache entry Skill-->>Client: skill.updated Client->>Skill: refetch catalog Skill->>Config: rescan source