fix(cursor): bound slug path resolution - #81
Open
yardenhochman wants to merge 1 commit into
Open
Conversation
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.
Summary
Problem
cwdFromSlug()tries/,., and literal-for every dash. When a Cursor project points to a deleted temporary path, the exhaustive search grows as3^n; a 21-dash scratchpad slug can peg a CPU core and leave the session picker on “Loading sessions.”Verification
pnpm test— 918 passed, 2 platform skipspnpm exec biome check src/utils/slug.ts src/__tests__/cwd-from-slug.test.tspnpm run buildThe repository-wide
pnpm run checkcurrently reports pre-existing formatter drift insrc/parsers/antigravity.ts,src/parsers/copilot.ts, andsrc/parsers/droid.ts; this branch does not touch those files.Summary by cubic
Bound path resolution for Cursor project slugs to prevent exponential filesystem checks and session picker hangs. Adds a 10,000-check cap in
cwdFromSlugwhile keeping existing precedence and fallbacks.fs.existsSyncand verifies the cap and Unix fallback path.Written for commit 83673be. Summary will update on new commits.