Skip to content

Fix cursor project parsing#599

Merged
ozymandiashh merged 1 commit into
getagentseal:mainfrom
Enclavet:fix-cursor-projects
Jul 3, 2026
Merged

Fix cursor project parsing#599
ozymandiashh merged 1 commit into
getagentseal:mainfrom
Enclavet:fix-cursor-projects

Conversation

@Enclavet

@Enclavet Enclavet commented Jul 2, 2026

Copy link
Copy Markdown

Summary

  • Fixes Cursor usage being lumped under a single cursor project instead of the real workspace. Recent Cursor builds renamed the per-workspace composer list key from composer.composerData to composer.composerHeaders (identical { allComposers: [{ composerId }] } shape); loadWorkspaceMap only read the old key, so every composer orphaned into the cursor catch-all.
  • loadWorkspaceMap now reads both keys and merges their allComposers lists — restoring per-project attribution on current Cursor while staying backward-compatible with older installs.
  • Adds a regression test covering the new composer.composerHeaders key and the legacy composer.composerData key.

Testing

  • I have tested this locally against real data (not just unit tests)
  • npm test passes *(cursor suite 13/13; build clean.
  • npm run build succeeds

For new providers only:

  • N/A — this fixes the existing Cursor provider, not a new one

Before (old composer.composerData-only query): all usage orphaned

projects: [ 'cursor' ] [cursor] calls=22 cost=$0.2506

After (this PR): usage attributed to the real workspace

discovered projects: [ '-Users-me-projects-superzoom', 'cursor' ] [-Users-me-projects-superzoom] calls=21 in=67472 out=7284 cost=$0.1653 [cursor] calls=1 in=545 out=5572 cost=$0.0852

Recent Cursor builds renamed the per-workspace composer list from
ItemTable['composer.composerData'] to 'composer.composerHeaders' (identical
{ allComposers: [{ composerId }] } shape). loadWorkspaceMap only read the old
key, so on these builds the composer->workspace map came back empty and every
composer fell through to the 'cursor' orphan bucket, losing per-project
attribution.

Read both keys and merge their allComposers lists (backward compatible with
older installs). Add a regression test covering the new composer.composerHeaders
key and the legacy composer.composerData key.

Verified against a real workspace state.vscdb: composer.composerData absent,
composer.composerHeaders present with composerIds matching the bubbleId/
composerData rows; 21/22 calls now attribute to the real workspace instead of
the 'cursor' orphan bucket.

AI-Origin: human

@ozymandiashh ozymandiashh left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good and safe to merge. The fix is minimal, preserves the legacy composer.composerData path, and correctly reads the newer composer.composerHeaders key so project attribution works across Cursor versions.

Non-blocking suggestions:

  • Update the workspace mapping comment in src/providers/cursor.ts to mention both composer.composerData and composer.composerHeaders.
  • Consider adding one regression test for the transition case where both keys are present in the same workspace DB, to lock in the intended merge behavior.

I ran the cursor provider tests and build locally. The broader suite has unrelated pre-existing failures on the same files when checked against origin/main, so I do not consider those a regression from this PR.

@ozymandiashh ozymandiashh merged commit 1678cbd into getagentseal:main Jul 3, 2026
3 checks passed
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.

3 participants