Repository navigation
Fix OpenCode plugin loading, validation, and asset upgrades - #3
Merged
Merged
Conversation
|
Review the following changes in direct dependencies. Learn more about Socket for GitHub.
|
starmorph
marked this pull request as ready for review
October 8, 2026 22:20
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.
This PR fixes nine OpenCode integration problems inherited from main. The skills sync and version bump remain in #2.
Problems and fixes
The npm plugin installs but does not load.
Problem: OpenCode's package loader cannot find the plugin entry point with only the existing root export.
Fix: Add a
./serverexport pointing to the plugin entry point.The npm setup command silently does nothing.
Problem: The executable checks its own filename against the npm-created symlink path, so its setup function never runs.
Fix: Resolve the symlink before checking whether the file is being executed directly.
Relative Blueprint paths use the wrong directory.
Problem: Validation resolves paths from the OpenCode server's working directory, which can differ from the user's project directory.
Fix: Resolve paths from the tool's session directory, or the plugin's project directory for automatic validation.
Validation can check the wrong Blueprint file.
Problem: The requested filename is omitted from the Render CLI call. Render defaults to
render.yaml, even when the agent requestedrender.yml.Fix: Pass the requested absolute filename explicitly, along with
--output json.GPT-style patch edits do not trigger validation.
Problem: The hook searches ordinary tool arguments for filenames and misses OpenCode's
apply_patchcalls.Fix: Read the patch result's file metadata, validate every affected Blueprint and moved destination, and skip deleted files. Include a path-header fallback for clients without that metadata.
Reads trigger validation, and explicit validation runs twice.
Problem: The hook runs whenever tool arguments contain a Blueprint path, including reads and the explicit validation tool itself.
Fix: Run automatic validation only after file-mutation tools:
write,edit,multiedit, andapply_patch.npm setup overwrites existing Render MCP settings.
Problem:
--enable-mcpreplaces an existingmcp.renderentry, including disabled servers or custom authentication settings.Fix: Preserve the existing entry unless
--forceis supplied; retain other config fields and MCP servers when replacing it.Both installers ignore the XDG config location.
Problem: Installation defaults to
~/.config/opencodeeven when the user configured a different XDG directory.Fix: Use this precedence:
--config-dir,OPENCODE_CONFIG_DIR,XDG_CONFIG_HOME/opencode, then~/.config/opencode.Upgrades leave a mixture of old and new skills.
Problem: Existing files are skipped, so old skill instructions remain alongside new references, and obsolete references are never removed.
Fix: Track installed file hashes, update unchanged bundled files, remove obsolete unchanged files, and preserve user edits. Recognize unchanged legacy 0.1.0 installations too.
--forcereplaces modified bundled files.Supporting changes
Verification
Merge these integration fixes first, then update #2 before releasing.