Skip to content

fix: handle # compound-path separator in fingerprintFile#358

Merged
iamtoruk merged 1 commit into
getagentseal:mainfrom
renerichter:fix/fingerprint-compound-path-separators
May 19, 2026
Merged

fix: handle # compound-path separator in fingerprintFile#358
iamtoruk merged 1 commit into
getagentseal:mainfrom
renerichter:fix/fingerprint-compound-path-separators

Conversation

@renerichter
Copy link
Copy Markdown
Contributor

Problem

The Cursor provider encodes workspace context into source paths as
<dbPath>#cursor-ws=<workspace> (introduced for workspace-aware routing).
fingerprintFile in session-cache.ts only has a fallback for the :
separator (used by OpenCode's <dbPath>:<sessionId> encoding).
On macOS/Linux, paths contain no colons, so lastIndexOf(':') returns -1
and Cursor sources silently return null — causing them to be skipped
entirely in parseProviderSources.

Fix

Add a # fallback before the existing : check in fingerprintFile.
The first stat() on the full path still succeeds for real files that
legitimately contain #, so there is no regression.

Tests

4 new test cases in tests/session-cache.test.ts:

  • Resolves #cursor-ws= compound path to base file
  • Resolves :session_id compound path to base file
  • Returns null when base file doesn't exist
  • Prefers # separator over : when both are present

All 884 existing tests continue to pass.

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.
@renerichter renerichter force-pushed the fix/fingerprint-compound-path-separators branch from 4ca2491 to 79ea2d5 Compare May 19, 2026 10:26
@iamtoruk iamtoruk merged commit 3542407 into getagentseal:main May 19, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants