Repository navigation
fix(core): bound skill discovery and watches - #55597
Merged
Merged
Conversation
Contributor
There was a problem hiding this comment.
This fixes the store watch. I ran the #55367 reproduction from source against a fake store of about 5,000 directories with a symlinked SKILL.md pointing into it. On the base, the server watched the whole store recursively and held about 5,065 inotify watches. With this change, it holds a single file watch on the skill target, about 15 inotify watches in total, and the nix.expert skill still loads. The skill config tests and typecheck in packages/core pass.
Public API: no SDK, HTTP, plugin, config or CLI surface changes. Skill discovery rules do change: these skills no longer load:
SKILL.mdfiles nested inside another skill- skills under hidden directories or
node_modules - hidden root
.mdfiles - root
.mdfiles next to a rootSKILL.md
The docs cover the new rules.
I have no blocking concerns.
This was referenced Oct 15, 2026
rekram1-node
force-pushed
the
bounded-skill-scan
branch
from
October 15, 2026 05:03
0d5d715 to
29b238d
Compare
Replace the unbounded `{*.md,**/SKILL.md}` glob with a breadth-first skill
scan. A directory containing SKILL.md is one skill and is not searched
further, hidden entries and node_modules are skipped, and the scan stops six
directories below the source root.
Recursive skill watches ignore hidden entries and node_modules. A skill file
that resolves outside the watched sources gets a file watch instead of a
recursive watch on its parent, which could be all of /nix/store.
Co-authored-by: Dante <duanjl.china@gmail.com>
Co-authored-by: Kugesh Rajasekaran <47845948+kugesh-Rajasekaran@users.noreply.github.com>
rekram1-node
force-pushed
the
bounded-skill-scan
branch
from
October 17, 2026 23:42
0bd618b to
cb759d0
Compare
8 of 10 tasks
This was referenced Oct 20, 2026
hts1238
added a commit
to hts1238/opencode
that referenced
this pull request
Oct 21, 2026
Merge anomalyco/opencode dev through 055d95b, the final upstream revision before v2 promotion removed the legacy app and server. Keep the fork history and its session, timeline, model, push and OpenAI response-ID fixes. Keep the legacy interface as the default without an expiry. Persist an explicit layout preference so either interface remains selectable. Backport bounded skill discovery from upstream anomalyco#55597 and linear snapshot index updates from anomalyco#51996. Include upstream SSE cancellation handling and bounded provider retries from the compatible merge. Apply the fork's rotated response-ID SDK patch to OpenAI 3.0.88. Validation: app/core/opencode and e2e types; focused app, core and legacy server tests; regenerated clients; embedded local binary build and version smoke test. Three time-limited tests passed on isolated rerun. The original production streaming benchmark failed to complete, so no quantitative before/after performance claim is made.
5 tasks
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 #55367
Closes #45961
Closes #51080
Supersedes #55479 and #55234. Both authors are credited as co-authors on the commit.
Type of change
What does this PR do?
Skill discovery used
{*.md,**/SKILL.md}with symlinks followed, no depth limit and no exclusions. It descended intonode_modules, and symlink cycles crashed it. When a foundSKILL.mdresolved outside the watched sources, the plugin recursively watched the file's parent directory. home-manager linksSKILL.mdfiles straight into/nix/store, so that parent was the whole store: about 1.4M directories, enough to exhaustmax_user_watches.The skill and compatibility plugins now share
SkillScan.scan, a breadth-first walk:SKILL.mdis one skill, and the walk does not search inside it.*.mdfiles still count only at the source root.node_modulesare skipped.Watches are unchanged except for two things:
node_modules.A shared
FSUtil.ignoredDirectorieslist (node_modules,.git,.venv,venv,__pycache__) now backs the skill scan, the skill and config directory watches, and the supporting-file sampleSkill.preparebuilds for a loaded skill, which previously globbed everything inside the skill directory.Glob.Optionsgainsignorefor this.Behavior changes: a
SKILL.mdinside another skill's directory, skills under hidden directories, and skills more than six directories deep no longer load. The skills docs describe the rules and fix a stale note about rootSKILL.mdIDs.How did you verify your code works?
packages/core:bun typecheckand the config and skill tests pass (254).packages/utiltests pass. Rootbun run checkpasses.ignorelist and for the file watch on symlinked skills.node_modulesskipping, the depth limit, a symlinkedSKILL.mdand symlink cycles. The cycles finished in a few milliseconds.Screenshots / recordings
Not a UI change.
Checklist