fix: handle # compound-path separator in fingerprintFile#358
Merged
iamtoruk merged 1 commit intoMay 19, 2026
Merged
Conversation
The Cursor provider encodes workspace context into source paths using a `#cursor-ws=<tag>` suffix (e.g. `state.vscdb#cursor-ws=__orphan__`). `fingerprintFile` only had a fallback for `:` separators (OpenCode sessions), so Cursor sources silently returned null on macOS/Linux where paths contain no colons, causing them to be skipped entirely. Add a `#` fallback before the existing `:` check. The first `stat()` on the full path still succeeds for real files containing `#`, so there is no regression for legitimate paths. Includes 4 new test cases covering both separators, the combined case, and the null case for non-existent base files.
4ca2491 to
79ea2d5
Compare
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.
Problem
The Cursor provider encodes workspace context into source paths as
<dbPath>#cursor-ws=<workspace>(introduced for workspace-aware routing).fingerprintFileinsession-cache.tsonly has a fallback for the:separator (used by OpenCode's
<dbPath>:<sessionId>encoding).On macOS/Linux, paths contain no colons, so
lastIndexOf(':')returns -1and Cursor sources silently return
null— causing them to be skippedentirely in
parseProviderSources.Fix
Add a
#fallback before the existing:check infingerprintFile.The first
stat()on the full path still succeeds for real files thatlegitimately contain
#, so there is no regression.Tests
4 new test cases in
tests/session-cache.test.ts:#cursor-ws=compound path to base file:session_idcompound path to base file#separator over:when both are presentAll 884 existing tests continue to pass.