fix(opencode): skip eager import for disabled local tools#22114
Open
Astro-Han wants to merge 1 commit intoanomalyco:devfrom
Open
fix(opencode): skip eager import for disabled local tools#22114Astro-Han wants to merge 1 commit intoanomalyco:devfrom
Astro-Han wants to merge 1 commit intoanomalyco:devfrom
Conversation
9cb09ce to
a24f997
Compare
Author
|
The failing |
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 #22061
Type of change
What does this PR do?
Prevents eager import of disabled repo-local custom tools for the documented local tool shapes.
The change adds a cheap pre-scan in the custom tool registry so OpenCode can skip importing a local tool file when every documented tool ID from that file is already disabled by config. It covers the documented local patterns (
export default, directexport const/function) and also respects top-levelpermissiondenies.This keeps the fix narrow to
#22061and avoids changing unrelated dependency install behavior.How did you verify your code works?
cd packages/opencode && bun test test/tool/registry.test.tscd packages/opencode && bun typecheckpermissiondeniesScreenshots / recordings
Not applicable.
Checklist