Repository navigation
Detect and surface recoverable zero-turn sessions in AI Vault - #7889
Conversation
Identify Claude sessions with no saved conversation turns but possessing recoverable signals such as queued prompts or subagent transcripts. This displays them in the sidebar with a "Not saved" badge instead of filtering them out as empty, and provides detailed notices to recover them via logs while disabling standard resume actions. Additionally, extract Gemini session parsing logic into a separate module and support counting sibling subagent transcripts across local and remote SSH session scans.
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Repository UI Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (37)
📝 WalkthroughWalkthroughThis change adds recoverable-signal tracking for zero-turn AI Vault sessions. New backend logic counts sibling subagent transcript files and tracks queued message operations, extending the shared session type, accumulator, primary parsers, parse cache, and both local and remote scanners with 🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✨ Finishing Touches📝 Generate docstrings
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
…ts-to-mobile Reconciles the mobile aiVault.listSessions RPC with main's runtime-host scanning (#7631), OMP sessions (#7618/#7628), host-aware attribution (#7367), and zero-turn recovery (#7889): - One aiVault.listSessions serves mobile (no executionHostId), the desktop parent, and web clients: bounded params kept, results served from the shared host-local cache and restamped per-caller at the RPC edge. - Desktop's runtime-host RPC client caps scopePaths to the shared bound so large desktops degrade gracefully instead of failing validation. - Desktop IPC local scope delegates to the shared cache module (single cache with the RPC path); ssh/runtime/all merges keep main's outer cache. - Main's zero-turn empty-session semantics and ExecutionHostId-typed project attribution replayed onto the /shared lifted filter core. - Mobile resume forwards session.filePath so OMP resumes by absolute transcript path (desktop parity). Co-authored-by: Orca <[email protected]>
Main already counts sibling subagent transcripts (stablyai#7889) for zero-turn recovery; this PR was written before that landed and added a parallel subagentCount doing the same readdir. Keep one field: count every local session's transcripts in the shared Claude finalize (one readdir per parse instead of two extra call sites), attach remote counts from the walk listing for all sessions, and gate the on-demand subagent listing UI to local sessions. Net effect vs the PR: SSH rows now show a real subagent count badge; listing stays local-only. Co-authored-by: Orca <[email protected]>
…ai#7889) Identify Claude sessions with no saved conversation turns but possessing recoverable signals such as queued prompts or subagent transcripts. This displays them in the sidebar with a "Not saved" badge instead of filtering them out as empty, and provides detailed notices to recover them via logs while disabling standard resume actions. Additionally, extract Gemini session parsing logic into a separate module and support counting sibling subagent transcripts across local and remote SSH session scans.
Summary
Detect and surface recoverable zero-turn sessions in the AI Vault.
Previously, zero-turn sessions (sessions where the conversation transcript persisted zero user or assistant turns) were either hidden or treated as normally resumable, which would lead to resuming into an empty conversation. This PR detects and surfaces recoverable signals—specifically queued (never-flushed) prompts and sibling subagent transcripts—allowing these "unsaved" sessions to be surfaced with a distinct status instead of being hidden or broken on resume.
Key changes:
queue-operationrecords) and sibling subagent transcripts (viasubagentTranscriptsDirFordirectory counting) for local and remote (SSH) Claude/Gemini sessions.SessionUnsavedConversationNoticeinAiVaultSessionUnsavedNotice.tsxto display detailed breakdown of recoverable items (queued messages, subagent transcripts).Screenshots
No visual change.Testing
pnpm lintpnpm typecheckpnpm testpnpm buildEvidence: Added comprehensive unit tests in
session-scanner-recoverable-empty.test.tsandai-vault-types.test.ts, and updated existing tests inremote-session-scanner.test.ts,ai-vault-session-filters.test.ts, andai-vault-session-resume.test.ts.AI Review Report
This change has been reviewed with the following checks:
basename,dirname,extname,joinfromnode:path) and respected theplatformparameter when formatting shell commands and paths. Sibling counting properly filters Windows and POSIX-style paths.queuedMessageCountandsubagentTranscriptCount).Security Audit
Notes
readdircalls, preserving SSH scanning performance.