feat(plugin): expose skills API to plugins via PluginInput.skills#29356
Open
sjawhar wants to merge 1 commit into
Open
feat(plugin): expose skills API to plugins via PluginInput.skills#29356sjawhar wants to merge 1 commit into
sjawhar wants to merge 1 commit into
Conversation
6 tasks
Provide Skill.Service in Plugin.layer so EffectBridge captures it in the closure. Without this, external plugins calling input.skills.* would fail with 'Service not found: @opencode/Skill' because the bridge captures Effect.context() at layer construction time, before the runtime provides Skill. Fix the bridged callbacks to use the captured 'skill' service directly rather than re-looking up Skill.Service inside bridge.promise. Add Skill.defaultLayer to Plugin.defaultLayer so the dependency is self-contained for the new skills API. Update test layers in loader-shared.test.ts and auth-override.test.ts to provide Skill alongside the bare Plugin.layer they construct directly. Also remove the global OPENCODE_DISABLE_DEFAULT_PLUGINS=true from test/preload.ts — hoisting it to the global preload broke any test that relies on default plugins being loaded (digitalocean router synthesis, session.llm OpenAI tests). The skill-specific tests that need plugins disabled (loader-shared, native-skills) set the env var themselves with proper afterAll cleanup, so removing the global default doesn't affect them.
a1bef44 to
28db1bc
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.
Issue for this PR
Closes #18688
Re-submission of #18686 (closed by automated cleanup), rebased onto current dev. The previous PR could not be reopened because the branch has been force-pushed since closure.
Type of change
What does this PR do?
Exposes the native skills API (
skill.all(),skill.get(name),skill.dirs()) to plugins viaPluginInput.skills, matching the feature request in #18688. This lets plugins discover and reason about user-defined skills the same way the agent runtime does.How did you verify your code works?
New
test/plugin/native-skills.test.tscovers the plugin-input surface end-to-end. Adjacent tests updated to provide the newSkilllayer dependency.bun typecheckpasses.Checklist