Repository navigation
refactor(plugin): centralize host resolution - #46901
Merged
Merged
Conversation
This was referenced Sep 2, 2026
This was referenced Sep 6, 2026
jinhuang712
pushed a commit
to jinhuang712/opencode
that referenced
this pull request
Sep 26, 2026
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
No linked issue.
Type of change
What does this PR do?
Adds
@opencode-ai/plugin/hostwith sharedresolveandloadfunctions. Server, TUI, and CLI consumers use it instead of selecting plugin entrypoints independently. TUI-only plugins no longer need an index/server entrypoint.Resolution uses Bun's native resolver or Node ESM resolution with existence checks and Node-only extension fallback. It neither installs packages nor executes plugin code. Npm now returns package metadata only; provider loaders resolve their own modules. Reuses staged installation metadata and removes
resolve.exports.Adds host-resolution tests for packages with exports, without exports, and without a manifest; removes two low-value tests.
Known follow-ups left unchanged: Node can treat an uncached unnamed Git spec as a module URL, and its existence check can accept a directory rather than a file.
How did you verify your code works?
bun typecheckin plugin, util, core, tui, and cli.git diff --check.Screenshots / recordings
Not applicable; no visual changes.
Checklist