fix(opencode): skip dependency directories during skill discovery - #51278
Open
kugesh-Rajasekaran wants to merge 1 commit into
Open
kugesh-Rajasekaran wants to merge 1 commit into
kugesh-Rajasekaran wants to merge 1 commit into
Conversation
Pass ignore globs through Glob.scan so discovery does not descend into node_modules, .git, dist, or .cache. Skip a scan root already seen by realpath, so a skills symlink is not walked twice. Fixes anomalyco#51080
Contributor
|
The following comment was made by an LLM, it may be inaccurate: |
This branch has not been deployed
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 #51080
Type of change
What does this PR do?
Skill discovery scans
skills/**/SKILL.mdbefore the TUI is ready. On 1.18.31, three cold starts took 13.3s, 10.0s, and 6.6s to reachbooting location services. On the fastest run the skill scan itself was 2.3s.node_modulesand.gitinside a skill were walked, and~/.claude/skillsis a symlink to~/.agents/skills, so that tree was walked twice.Glob.scannow takes anignorelist and passes it to theglobpackage. Discovery passes**/node_modules/**,**/.git/**,**/dist/**, and**/.cache/**. A pattern ending in/**makes the walker return before it reads that directory. NestedSKILL.mdfiles outside those directories are still found. A scan root already seen by realpath is skipped, so the symlink is walked once.How did you verify your code works?
bun typecheckinpackages/coreandpackages/opencode. The pre-push hook typechecked all 36 packages.bun testfortest/skill/skill.test.ts,test/util/glob.test.ts, andtest/tool/skill.test.ts. The new case coversnode_modules,.git, and a skills symlink.packages/opencodesuite (3636 tests) had 29 failures in workspace routing andopencode run. Those same tests pass when run on their own, on this branch and ondev.Screenshots / recordings
Not a UI change.
Checklist