fix: resolve current Cursor acp-sessions/<sessionId>/store.db layout (0.4.0) - #3
Merged
Merged
Conversation
…(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.
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.
TL;DR
Cursor moved its ACP session storage layout.
findSessionStorePathno longer finds any current session, breaking enrichment for downstream consumers.Summary
~/.cursor/acp-sessions/<sessionId>/store.db. The legacy hashed layout (~/.cursor/chats/<hash>/<sessionId>/store.db) still exists for pre-migration sessions.findSessionStorePathonly scanned the legacychats/tree, so every recent Cursor session threwSessionNotFoundError. Incursor-acp-enriched's primary consumer (laze-ai) the enricher swallows that error insidetryEnrich, so the failure was invisible — tool calls just rendered without args / results.existsSynccall, fall back to the legacy hashed scan, and update the error message + comment to reference both layouts.blobs(id, data),tool-call/tool-resultJSON shape,providerOptions.cursor.highLevelToolCallResult) is unchanged, sostoreReader.tsneeds no changes.0.4.0. Also retroactively documented the missing0.3.0entry (richResult).Testing
npm run typechecknpm run lintnpm run format:checknpm run buildnpm run test— 25 tests pass, including new cases for flat layout, legacy fallback, layout preference, and missing-in-both~/.cursor/acp-sessions/<id>/store.db—findSessionStorePath()resolves to the flat path