Skip to content

fix: resolve current Cursor acp-sessions/<sessionId>/store.db layout (0.4.0) - #3

Merged
antonvp merged 1 commit into
mainfrom
fix/path-discovery-acp-sessions
May 4, 2026
Merged

fix: resolve current Cursor acp-sessions/<sessionId>/store.db layout (0.4.0)#3
antonvp merged 1 commit into
mainfrom
fix/path-discovery-acp-sessions

Conversation

@antonvp

@antonvp antonvp commented May 4, 2026

Copy link
Copy Markdown
Owner

TL;DR

Cursor moved its ACP session storage layout. findSessionStorePath no longer finds any current session, breaking enrichment for downstream consumers.

Summary

  • Cursor now writes per-session SQLite stores to a flat path: ~/.cursor/acp-sessions/<sessionId>/store.db. The legacy hashed layout (~/.cursor/chats/<hash>/<sessionId>/store.db) still exists for pre-migration sessions.
  • Before this PR findSessionStorePath only scanned the legacy chats/ tree, so every recent Cursor session threw SessionNotFoundError. In cursor-acp-enriched's primary consumer (laze-ai) the enricher swallows that error inside tryEnrich, so the failure was invisible — tool calls just rendered without args / results.
  • Fix: probe the flat path first via a single existsSync call, fall back to the legacy hashed scan, and update the error message + comment to reference both layouts.
  • DB schema (blobs(id, data), tool-call / tool-result JSON shape, providerOptions.cursor.highLevelToolCallResult) is unchanged, so storeReader.ts needs no changes.
  • Bumped to 0.4.0. Also retroactively documented the missing 0.3.0 entry (richResult).

Testing

  • npm run typecheck
  • npm run lint
  • npm run format:check
  • npm run build
  • npm run test — 25 tests pass, including new cases for flat layout, legacy fallback, layout preference, and missing-in-both
  • Smoke test against a live ~/.cursor/acp-sessions/<id>/store.dbfindSessionStorePath() resolves to the flat path

…(0.4.0)

Cursor moved its ACP session storage from
~/.cursor/chats/<hash>/<sessionId>/store.db to a flat
~/.cursor/acp-sessions/<sessionId>/store.db. findSessionStorePath only
scanned the legacy chats/ tree, so every session created by current
Cursor builds threw SessionNotFoundError and consumers (e.g. laze-ai)
silently lost tool-call enrichment.

Check the flat path first, fall back to the legacy hashed layout so
pre-migration sessions keep resolving. Tests cover both layouts and
the preference order.
@antonvp
antonvp merged commit 4801804 into main May 4, 2026
1 check passed
@antonvp
antonvp deleted the fix/path-discovery-acp-sessions branch May 4, 2026 10:06
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.

1 participant