fix(skill): read plugin-modified config for skills.paths discovery#20939
Open
sjawhar wants to merge 1 commit intoanomalyco:devfrom
Open
fix(skill): read plugin-modified config for skills.paths discovery#20939sjawhar wants to merge 1 commit intoanomalyco:devfrom
sjawhar wants to merge 1 commit intoanomalyco:devfrom
Conversation
Contributor
|
Thanks for your contribution! This PR doesn't have a linked issue. All PRs must reference an existing issue. Please:
See CONTRIBUTING.md for details. |
c537bbd to
1d7ad72
Compare
|
good catch, hope it can be merged soon. |
Plugin config() hooks that mutate cfg.skills.paths (e.g. superpowers) were invisible to skill discovery because each service's makeRuntime creates a separate InstanceState scope. Plugin.config() now exposes the post-hook config as the single source of truth.
1d7ad72 to
a7ce39e
Compare
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.
Fixes #20940
Issue for this PR
Related: #20026 (same root cause for providers), PR #20777
Type of change
What does this PR do?
Plugins that register skill directories via their
config()hook (e.g. superpowers) are invisible to skill discovery. The plugin mutatescfg.skills.paths, but the Skill service never sees it.Root cause: Each service's
makeRuntimecreates a separateInstanceStatescope. When Plugin callsconfig.get()and a plugin'sconfig()hook mutatescfg.skills.paths, that mutation only affects Plugin's scoped copy of the config. When Skill independently callsconfig.get(), it gets a separate copy — the mutation is invisible.This is the same class of bug as #20026 (plugin providers disappearing after instance dispose).
Fix: Plugin already runs config hooks and holds the post-hook config object. This PR:
Plugin.config()— the single source of truth for post-hook config.Plugin.config()(via dynamic import, same pattern Plugin already uses forSkill.all()) to readskills.pathsfrom the authoritative source.No replay of hooks, no layer dependency changes, no circular imports.
Before: 50 skills (0 from superpowers plugin)
After: 64 skills (14 superpowers skills discovered)
How did you verify your code works?
bun typecheck— cleanbun test test/skill/skill.test.ts— 11 pass, 0 failChecklist