fix(provider-cursor): installed node_modules no longer exhaust skill discovery #19806
main fromrefs/pull/19806/head·merged by juliusmarminge View on GitHubProblem#
Installed test dependencies under ~/.agents/skills/<skill>/tests/node_modules/ can exhaust Cursor's shared 10,000-entry scan budget. The probe then fails with scan-budget-exhausted, and the $ picker shows no skills.
Change#
The skill walk skips entries named exactly node_modules before it stats or recurses into them. The directory still costs its one entry, and the entry budget stays a hard stop. A SKILL.md inside a node_modules package under a skills root no longer appears. The maintainer triage asks for this skip, and Cursor's own skill loader in @cursor/sdk 1.0.35 skips node_modules while looking for SKILL.md, so such a skill would not load in Cursor either.
Scope and approval#
Refs #17215. This fixes the reopened case, installed dependencies under a skill. It does not change the entry budget's hard failure for other large trees (run artifacts, large skill folders), because that needs the maintainer choice asked on 2026-10-11. Dot-directories are still walked; the open reports do not need that skip.
Verification#
On Linux, vp test run packages/provider-cursor/src/server/skills.test.ts: 7/7 pass. The new test puts 10,001 entries under review/tests/node_modules next to a sibling skill and a skill in a later root, and asserts the probe returns all three. With only skills.ts reverted, the probe fails with scan-budget-exhausted and the test fails its success assertion. The existing test that a root over the entry budget still fails is unchanged. The new test also passes with a symlinked TMPDIR on Linux.
vp fmt --check and vp lint on the two changed files and vp run --filter @t3tools/provider-cursor typecheck pass.
A real Linux filesystem HOME with 9,091 entries under one skill's tests/node_modules and 1,200 ordinary support files fails on main with scan-budget-exhausted; with the fix the probe returns the skill, its sibling and the later-root skill. Not run on macOS; the cause is filesystem traversal and does not depend on the OS. These checks call probeCursorSkills directly, not a signed-in provider refresh or the composer. The $ picker renders this server data, and no UI code changes.
Model: GPT-6.1-Sol, Claude Sonnet 5.5, Claude Fable 5.1 (review), GPT-6-Astra (review). Harness: Codex, Claude Code.
- 1
github-actions[bot](GitHub profile, opens in a new tab) added labelsvouch:unvouched
github-actions[bot](GitHub profile, opens in a new tab) added labelssize:XS
macroscopeapp[bot](GitHub profile, opens in a new tab) approved these changes
No actionable comments were generated in the recent review. 🎉
ℹ️ Recent review info
-
⚙️ Run configuration
-
- Configuration used: Path: .coderabbit.config.ts
- Review profile: CHILL
- Plan: Advanced
- Run ID:
ee899aae-66af-4d74-8ac4-a6a0d3495680
📥 Commits
-
Reviewing files that changed from the base of the PR and between 339179f50a84dc599cce373dbb48f172f182f44e and 48b7803d5d625dd2d6e7c30633f3fc9b5f847e03.
📒 Files selected for processing: 2
-
packages/provider-cursor/src/server/skills.test.tspackages/provider-cursor/src/server/skills.ts
Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 9 remain after this review.
-
📝 Walkthrough
-
Cursor skill discovery now skips
node_modulesentries after charging them against the shared scan budget. A test covers discovery across multiple user skill roots when one skill contains 10,001 entries undernode_modules.Changes: Cursor skill discovery
Layer / File(s) Summary Skip node_modulesduring skill discovery
packages/provider-cursor/src/server/skills.ts,packages/provider-cursor/src/server/skills.test.tsDiscovery skips node_modulesentries after charging them against the shared scan budget. The test checks that discovery returns the expected skill directories, sorted by name, across multiple user roots.Priority: ⬇️ Low
Estimated code review effort: 2 (Simple) | ~10 minutes
Change: Bug fix
Suggested reviewers:
juliusmarminge
### Architecture SummaryMerge Risk: ⚪ Minimal · up to
48b78-
Cursor skill discovery will no longer run out of its scan budget because of installed node_modules directories. The change is small and covered by a regression test, and no merge-blocking risk was identified.
Architecture risk: 🔵 Low · up to
48b78The change affects 1 system.
Changed systems:
packages/provider-cursorArchitecture concerns No architecture-level concerns identified.
Review details
-
Systems and components
- observed — packages/provider-cursor (library) was modified; 2 changed files map to changed impact.
Before / after behavior
- observed — Modified behavior in packages/provider-cursor/src/server/skills.test.ts: Adds coverage that
probeCursorSkillssucceeds across multiple user skill roots and returns the expected skills sorted by name, even when a skill contains 10,001 entries undertests/node_modules. - observed — Modified behavior in packages/provider-cursor/src/server/skills.ts: After charging each directory entry against the shared scan budget, discovery now skips
node_moduleswithout statting or traversing it.
Pre-merge checks:
4-
Passed checks: 4 passed-
Check name Status Explanation Title check The title clearly and concisely describes the primary fix: preventing installed node_modules directories from exhausting Cursor skill discovery. Description check The description includes complete Problem, Change, Scope and approval, and Verification sections. It explains the affected behavior, implementation, scope limits, maintainer context, test results, add… Linked Issues check Check skipped because no linked issues were found for this pull request. Out of Scope Changes check Check skipped because no linked issues were found for this pull request.
-
✨ Finishing Touches
-
🧪 Generate unit tests (beta)
-
- Create a new PR
-
- Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts
-
juliusmarminge merged this167f5ec
juliusmarminge closed this
Sign in to join this conversation.
Approvability#
Verdict: Approved at
48b7803Macroscope's review found this PR approvable — This is a small, self-contained fix to prevent
You can add or adjust custom eligibility rules. [Learn more](https://docs.macroscope.com/approvability#example-custom-eligibility-rules).node_modulesfrom consuming the skill-discovery scan budget, with a focused regression test covering sibling and later roots. It introduces no schema, deployment, security, billing, authentication, or static-analysis configuration changes.