7 months ago
900bfb0* feat(server): add harness session snapshot projections * refactor(desktop): hydrate threads from harness snapshots * test(desktop): align snapshot restore regressions * fix: workspace path parity for sessions, legacy lastEventSeq, desktop snapshot skip - Add canonicalWorkspacePath/sameWorkspacePath and use for get_session_snapshot permission checks and SQLite listSessions filtering (in-memory after fetch) - listPersistedSessionSnapshots accepts optional workingDirectory filter; legacy summaries use LEGACY_JSON_SESSION_LIST_LAST_EVENT_SEQ (0); document in protocol - Desktop selectThread: skip get_session_snapshot when feed loaded and cache fingerprint matches - Tests: session-store filter + sentinel, session-db path normalization, server snapshot alias path, desktop warm-cache regression Made-with: Cursor * Prevent saving empty draft threads in desktop app * Extract desktop test JSDOM harness * Fix Windows workspace path comparisons * Fix session snapshot prompt state tracking * Fix desktop thread reconnect snapshot waiter handling * Fix desktop snapshot cleanup and timeout waiter leaks * fix(desktop): scrub removed thread cache and preserve drafts Prevent deleted thread data from lingering in cached desktop snapshots, preserve draft threads during session reconciliation, and drop outdated build verification guidance from AGENTS.md. Made-with: Cursor * fix(desktop): validate and prune cached session snapshots Prevent malformed or deleted session snapshot cache entries from surviving desktop bootstrap or workspace session refreshes. Made-with: Cursor * fix: recover from dropped selections and bad resumes Keep desktop thread selection valid after session refreshes remove the active thread, and fall back to synthesized snapshots when persisted resume projections are malformed. Made-with: Cursor * fix: thread migration and session snapshot edge cases Fix 5 issues identified in code review: 1. bootstrap.ts: Fix legacyTranscriptId calculation to capture original thread.id whenever it differs from computed id, ensuring proper tracking during migration scenarios when sessionId changes from null 2. thread.ts: Fix race condition by only applying cached snapshot when skipHarnessSnapshotFetch is true. Add fallback to apply cached snapshot when harness fetch fails instead of leaving thread in transcript-only mode 3. thread.ts: Fix silent error handling in readTranscriptEvents() to propagate errors when all transcript reads fail, preventing empty arrays from being misinterpreted as valid empty transcripts 4. threadEventReducer.ts: Preserve legacyTranscriptId when filtering out duplicate threads during migration. Copy legacyTranscriptId from filtered thread to replacement thread if replacement lacks one 5. runtimeState.ts: Remove threadSelectionRequests from rekeyThreadRuntimeMaps to prevent stale selection request entries after thread ID migration. Selection requests stay with original thread ID and are cleared by selectThread() * fix(desktop): address PR review issues for thread selection - Add selection currency check after cached snapshot application to prevent stale state during async operations - Add debug logging for session snapshot fingerprint mismatches - Document draft threadephemerality in persistence helpers - Document thread identity migration flow in websocket-protocol.md * fix: handle stale snapshots and parse errors in session hydration - Validate snapshot freshness in loadInitialSessionSnapshot by comparing lastEventSeq against persisted record. Falls back to legacy snapshot when DB snapshot is stale, preventing silent turn loss after unclean shutdown. - Wrap getSessionSnapshot in try/catch in SessionAdminManager to catch parse errors from malformed/schema-mismatched JSON. Gracefully falls back to legacy snapshot instead of returning internal_error.
Parent1987b68