fix: pre-build custom tools instead of naively import()ing them#13895
Open
demostanis wants to merge 1 commit intoanomalyco:devfrom
Open
fix: pre-build custom tools instead of naively import()ing them#13895demostanis wants to merge 1 commit intoanomalyco:devfrom
demostanis 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. |
on first launch, opencode installs @opencode-ai/plugin. but without restarting opencode when it's done, the following error appears: error: Cannot find package 'zod' from '/home/demostanis/.config/opencode/node_modules/@opencode-ai/plugin/dist/tool.js'
7e6eaf0 to
a31796c
Compare
a31796c to
5622d15
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.
on first launch, opencode installs @opencode-ai/plugin. but without restarting opencode when it's done, the following error appears:
error: Cannot find package 'zod' from '/home/demostanis/.config/opencode/node_modules/@opencode-ai/plugin/dist/tool.js'
https://opncd.ai/share/phMT4NGN (seems buggy? my messages don't show correctly)
This is a quick vibe-coded fix with Claude Opus 4.6.
What does this PR do?
(Fixes #13887)
OpenCode installs @opencode-ai/plugin on first start to ~/.config/opencode/node_modules. However,
when having custom tools in ~/.config/opencode/tools, an error appears on the TUI:
error: Cannot find package 'zod' from '/home/demostanis/.config/opencode/node_modules/@opencode-ai/plugin/dist/tool.js'
(or similar with @opencode-ai/plugin)
A restart is needed for the error to disappear.
This is impactful on temporary systems, where ~/.config/opencode/node_modules will be frequently suppressed (my system runs on a tmpfs)
How did you verify your code works?
(to adapt)