Repository navigation
refactor(ai-vault): split the session scanner into a transcript reader and consumers - #19666
Conversation
…r and consumers The scanner's only output was the Session History summary; a second reader of the same transcripts (a search index) had nowhere to plug in without hooking the parse itself. Extract a reader that owns each file read, keeps the resumable cursor and publishes every decoded message to registered consumers. The session list stays a fold inside the parser and is the only consumer here. Parsers take an optional message sink instead of a scope. Also: read Cursor chats/<md5>/<uuid>/meta.json for cwd, title and timestamps (Cursor transcripts carry only role and message); share the lazily spawned worker-thread host between the OpenCode SQLite reader and the port-scan probe; probe OpenCode's schema before querying; keep the newest-N discovery set with a bounded insert instead of sort+slice. Session list output is byte-identical to main across all 18 providers cold and append-resumed; the one Cursor session gains cwd/timestamps from meta.json.
There was a problem hiding this comment.
✅ No new issues found.
Reviewed changes
- Reader / consumer split — the scanner's read path is separated into
session-transcript-reader(owns each file read and its cursor),session-transcript-channel(fans decoded messages to every consumer), andsession-transcript-consumers(the registry); the session list stays a fold inside the parser and is the only consumer wired today. - Cursor
meta.jsonenrichment — Cursor sessions now resolvechats/<md5 of cwd>/<uuid>/meta.jsonfor cwd, title and timestamps, folded into discovery freshness via an asynccontentDependencyPathso a rewrittenmeta.jsoninvalidates the parse cache; SSH content parses opt out. - Shared worker lifetime —
LazyWorkerThreadHostis extracted from the OpenCode SQLite client and reused by the port-scan probe client, removing the previously-duplicated lifecycle code. - Bounded discovery + schema probes —
SessionNewestFilesreplaces sort-all-then-slice; OpenCode SQLite probes its schema (session-scanner-opencode-sqlite-schema.ts) before querying so a changed layout degrades instead of throwing mid-read.
The reader/channel/consumer seam is clean, and the tests are behavioral rather than theatrical — they assert exact message streams, resume byte offsets, replace/append modes, and the once-only trailing-unterminated-line publication.
ℹ️ OpenCode SQLite sessions don't reach the message stream
parseAgentSessionFile routes OpenCode 1.17.x candidates to parseOpenCodeSqliteSessionViaWorker with no messages sink, so a registered consumer receives beginRead → zero messages → finishRead({ session, incomplete: false }) for those sessions. A future search-index consumer would silently treat every modern OpenCode session as having no messages. The legacy JSON OpenCode path does thread messages; worth an explicit note (or an opt-out flag) so the second reader doesn't mistake this for an empty transcript.
Technical details
# OpenCode SQLite path is invisible to transcript consumers
## Affected sites
- src/main/ai-vault/session-scanner-agent-parser.ts:61 — `parseOpenCodeSqliteSessionViaWorker(...)` receives no `messages`.
- src/main/ai-vault/session-transcript-reader.ts:132 — `readWholeTranscript` calls `parseAgentSessionFile(candidate, platform, channel)`, so the channel is handed to a path that never publishes.
## Required outcome
- Confirm this is deliberate (SQLite sessions out of scope for the first reader) and record it so the later search-index consumer accounts for it, or thread a sink through the SQLite worker path.
## Open questions for the human
- Is the search index meant to cover OpenCode SQLite sessions at all? If yes, this seam will need a second hook independent of the file-transcript reader.
ℹ️ Cursor chat-meta index is re-validated once per parsed session
applyCursorChatMeta runs on every finalize, and its early-return guard (cwd && createdAt && updatedAt && title) never trips for Cursor because the transcript never populates cwd. Each finalize outside withCursorChatMetaScan therefore re-runs readCursorChatMetaIndex (one readdir plus a stat per workspace hash). On a cold scan that is O(cursor sessions × workspace hashes) extra filesystem calls during parse, on top of the single index read discovery already did inside the scan scope. This is intentional per the "applies the fallback on every finalize of a resumed parse" test, so it is not a correctness issue — just a cost worth revisiting if cursor-heavy cold scans show up in traces.
DeepSeek Pro (free via Pullfrog for OSS) | 𝕏
|
Note Reviews pausedIt looks like this branch is under active development. To avoid overwhelming you with review comments due to an influx of new commits, CodeRabbit has automatically paused this review. You can configure this behavior by changing the Use the following commands to manage reviews:
Use the checkboxes below for quick actions:
📝 WalkthroughWalkthroughThe AI Vault scanner now streams bounded session discovery and resolves Cursor metadata within the scan scope. Transcript consumers receive normalized messages through supported parsers and resumable reads. Parse cache storage, transcript reading, and per-path parse coordination are separated. OpenCode SQLite access uses shared schema checks. Port scanning and OpenCode SQLite clients share lazy worker lifecycle management. Tests cover these flows and their refusal, resume, caching, and failure cases. Priority: ⬇️ Low Merge Risk: 🟡 Moderate · up to Session scanning can retain stale metadata after sibling access is refused, and OpenCode SQLite sessions cannot provide transcript messages to consumers. These correctness gaps should be addressed before merge. 🚥 Pre-merge checks | ✅ 3 | ❌ 2❌ Failed checks (2 warnings)
✅ Passed checks (3 passed)
Full details: Description checkExplanation The description provides a strong summary and verification details, but it omits required template sections, including the linked issue, Visual Proof with Resolution Add all required template sections. Include a ✨ Finishing Touches 💡 2📝 Generate docstrings 💡
🛠️ Fix failing CI checks 💡
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 |
There was a problem hiding this comment.
Actionable comments posted: 1
Caution
Some comments are outside the diff and can’t be posted inline due to platform limitations.
⚠️ Outside diff range comments (1)
src/main/ai-vault/session-scanner-agent-parser.ts (1)
61-65: 🎯 Functional Correctness | 🟠 Major | 🏗️ Heavy liftForward transcript messages for SQLite-backed OpenCode sessions.
readWholeTranscriptsupplies a liveTranscriptMessageChannel, but this branch does not pass it toparseOpenCodeSqliteSessionViaWorker. OpenCode 1.17.x SQLite sessions therefore return a folded session without delivering transcript messages to registered consumers.Extend the worker request and response path to publish normalized messages through
messages, or use a parser path that accepts the sink.
ℹ️ Review info
⚙️ Run configuration
Configuration used: Repository UI
Review profile: CHILL
Plan: Advanced
Run ID: d31d2817-154c-4d1b-8030-6948b00655a3
📒 Files selected for processing (40)
src/main/ai-vault/session-newest-files.test.tssrc/main/ai-vault/session-newest-files.tssrc/main/ai-vault/session-parse-cache-store.tssrc/main/ai-vault/session-scanner-accumulator.tssrc/main/ai-vault/session-scanner-agent-parser.tssrc/main/ai-vault/session-scanner-agent-sources.tssrc/main/ai-vault/session-scanner-antigravity-parser.tssrc/main/ai-vault/session-scanner-candidates.tssrc/main/ai-vault/session-scanner-cline-parser.tssrc/main/ai-vault/session-scanner-codex-parser.tssrc/main/ai-vault/session-scanner-codex-session-meta.tssrc/main/ai-vault/session-scanner-copilot-parser.tssrc/main/ai-vault/session-scanner-cursor-chat-meta.test.tssrc/main/ai-vault/session-scanner-cursor-chat-meta.tssrc/main/ai-vault/session-scanner-cursor-parser.tssrc/main/ai-vault/session-scanner-devin-parser.tssrc/main/ai-vault/session-scanner-discovery.tssrc/main/ai-vault/session-scanner-droid-parser.tssrc/main/ai-vault/session-scanner-gemini-parsers.tssrc/main/ai-vault/session-scanner-graph-parsers.tssrc/main/ai-vault/session-scanner-grok-parser.tssrc/main/ai-vault/session-scanner-hermes-parser.tssrc/main/ai-vault/session-scanner-kimi-parser.tssrc/main/ai-vault/session-scanner-opencode-parser.tssrc/main/ai-vault/session-scanner-opencode-sqlite-schema.tssrc/main/ai-vault/session-scanner-opencode-sqlite-worker-client.tssrc/main/ai-vault/session-scanner-opencode-sqlite.tssrc/main/ai-vault/session-scanner-parse-cache.tssrc/main/ai-vault/session-scanner-primary-parsers.tssrc/main/ai-vault/session-scanner-source-discovery.tssrc/main/ai-vault/session-scanner-types.tssrc/main/ai-vault/session-scanner.tssrc/main/ai-vault/session-transcript-channel.tssrc/main/ai-vault/session-transcript-consumers.test.tssrc/main/ai-vault/session-transcript-consumers.tssrc/main/ai-vault/session-transcript-message-content.test.tssrc/main/ai-vault/session-transcript-message-content.tssrc/main/ai-vault/session-transcript-reader.tssrc/main/lazy-worker-thread-host.tssrc/main/ports/port-scan-command-client.ts
Included review availability: Your plan provides up to 10 included reviews per hour; 7 remain after this review.
Overlapping parses of one transcript share the cached resume point's message channel, so the second beginRead dropped the first read's consumers and the first finishRead handed them the wrong outcome. Two callers really do overlap: a forced refresh restarts a scan while the aborted scan's parse is still in flight, and the title reader parses outside any scan. Restore the per-path lane around the whole lookup-read-store sequence. OpenCode's SQLite sessions are decoded on a worker thread the channel cannot reach, so their reads published no messages while reporting a complete span. Finish those reads as incomplete instead, so a consumer never records a cursor for a stream it did not receive.
|
(see above) |
There was a problem hiding this comment.
✅ No new issues found.
Reviewed changes
- Per-path parse serialization —
parseAgentSessionFileCachednow runs its whole lookup-read-store sequence insideinSessionParseFileLane(session-parse-file-lane.ts), so overlapping parses of one path (a forced refresh racing an aborted scan, plussession-title-file-reader.tsparsing outside any scan) no longer share a resume point's channel or move the cursor backwards. The chained-promise mutex is correct, including thepending.get(path) === runguard on cleanup. - Unpublished reads reported as incomplete —
parserPublishesMessages(false only for OpenCode SQLite candidates, using the same predicate as the parse router) letsreadWholeTranscriptreportincomplete: truefor reads whose messages decode on the worker thread and never reach the sink, closing the prior informational note about SQLite sessions silently reading as empty. - Behavioral tests — the two new cases assert an exact single append read with no orphaned outcome, and an
incomplete: trueoutcome for the mocked worker path; both fail with their respective fixes removed.
DeepSeek Pro (free via Pullfrog for OSS) | 𝕏
…g sessions A refused WSL read of Cursor's chats tree rethrew, and the per-file catch in discovery then recorded an issue and skipped the transcript. Before the meta.json join Cursor had no content dependency, so a stalled distro could not hide a Cursor session at all. Degrade to no metadata for the scan and report the chats root once. The parse cache stays honest without the throw: discovery stats no meta.json on a refused scan, so the entry's recorded size omits it and the next healthy scan re-reads the transcript. The per-scan index scope covered discovery only, so every Cursor finalize re-read the chats root to validate the module cache. Move the scope to scanAiVaultSessions, which spans discovery and parse. Also drop the unused signal parameters the sink threading added to the Devin and Hermes content parsers, by giving each file parser a private record parser instead.
|
Second review round (Opus adversarial pass) addressed in b04a171:
Known and documented, not changed: a consumer registered after a cache hit sees nothing for that file; the later indexer PR owns its own reads for that reason. |
There was a problem hiding this comment.
ℹ️ No critical issues — one minor observation inline about cache honesty in the new refusal path.
Reviewed changes
- Refusal degradation for the Cursor chats read — a refused WSL read of the chats tree (or of
meta.json) now degrades to "no metadata" instead of taking the session down, and the refused chats root is reported once as acursorscan issue rather than once per transcript. - Scan scope moved to span discovery + parse —
withCursorChatMetaScanwas lifted out ofdiscoverAiVaultSessionSourcesup toscanAiVaultSessions, so one scan reads the chats tree once across both phases; the scan is also wrapped in anaiVault.scantrace span. - Devin / Hermes parser cleanup — each file parser now delegates to a private
parse…Recordhelper and the content parsers drop the unusedsignalparameter the sink threading had introduced. - Behavioral tests — a new
cursor chat meta scan failuresblock asserts the refusal-then-heal flow (sessions listed without metadata, one issue for the chats root, healed on the next scan) and that the chats root is read exactly once per scan.
The scope move, the once-per-scan index read, and the heal behavior are all exercised by tests that would fail with their fixes reverted. The only gap is the meta.json-read refusal branch, noted inline.
DeepSeek Pro (free via Pullfrog for OSS) | 𝕏
…efused Discovery stats meta.json into the candidate's cache key, so when only the meta.json read is refused the un-enriched session was stored under a key that looks unchanged and reuseCachedSession never re-ran the enrich hook. The session stayed without cwd until Cursor rewrote the file. The enrich hook now reports 'refused', the resumable state exposes isCacheable, and the parse cache drops the entry instead of storing it, so the next healthy scan re-parses. The index-read branch is unaffected: it never stats meta.json, so its key is honest already.
There was a problem hiding this comment.
✅ No new issues found.
Reviewed changes
- Cache-honest
meta.jsonrefusal — a refusedmeta.jsonread now makes the parse non-cacheable: the enrich hook returns'refused',accumulatorFoldResumeStateexposesisCacheable(), andparseCachedInLanecallsinvalidateSessionParseCacheEntryinstead of storing an un-enriched result under an unchangedmtimeMs+sizeByteskey. This closes the prior gap where the index-read refusal was safe but themeta.json-read refusal left a metadata-less session cached until Cursor rewrote the file. - Scan-scoped refusal tracking —
readCursorChatMetarecords the refused transcript in a per-scanrefusedTranscriptsset, consulted bywasCursorChatMetaRefusedfromapplyCursorChatMeta, so the refusal is reported once per chats root (not per transcript) and surfaces as'refused'only for the branch that actually needs it. - Behavioral test — the new
does not cache an un-enriched session when only its meta.json read is refusedcase mockswslGatedReadFile(so discovery stays healthy while only the parse-time read fails) and asserts the refused scan lists the sessions withoutcwdand that a follow-up scan heals them. It fails if the store is forced back on.
The reader-side flag (read.cacheable) is threaded only through the resumable path, which is correct: Cursor is the sole enrichBeforeFinalize user and the sole resumable parser that can refuse, while every other accumulator-fold state keeps enrichmentRefused permanently false.
DeepSeek Pro (free via Pullfrog for OSS) | 𝕏
sizeBytes folds a content dependency's size in, so it is a cache key rather than a file length. The reader compared a transcript byte offset against it and reported it as a whole-file read offset, which for Cline handed consumers an offset past the end of the file it read. Carry the dependency's own size on FileWithMtime and subtract it in the reader. A refused sibling stat rethrew, so discovery recorded an issue and skipped the transcript, the same drop removed for the readdir and read paths. Degrade to no dependency, note the tree once, and mark the key untrustworthy. An untrustworthy key no longer costs the resume cursor: the entry is stored under an mtime no stat can produce, so unchanged is false while the resume point survives and the next scan resumes instead of re-reading the whole transcript.
|
Third review round (second Opus adversarial pass) addressed in 9909ff3:
All three mutation-checked. CI green on the prior head; rerunning. |
Both refusal tests asserted that a later healthy scan re-enriches, which a plain store would also satisfy once the resume cursor was preserved. Assert the cache entry directly: its mtime is the unmatchable sentinel and its resume point survives. The sentinel is exported so the tests name the contract instead of repeating -1.
There was a problem hiding this comment.
Caution
Some comments are outside the diff and can’t be posted inline due to platform limitations.
⚠️ Outside diff range comments (1)
src/main/ai-vault/session-scanner-parse-cache.ts (1)
158-159: 🗄️ Data Integrity & Integration | 🟠 Major | ⚡ Quick winDo not reuse a cache entry after a refused dependency stat.
A whole-file candidate can set
file.contentDependencyRefused, but this branch stores its normal mtime and incomplete size key. A later scan with the same refused stat satisfiesunchangedand reuses the cached session without reparsing. Dependency-derived fields can then remain stale while the stat failure persists.Store
UNMATCHABLE_MTIME_MSfor whole-file entries whenfile.contentDependencyRefusedis true. Add a regression test for a whole-file parser with a refused sibling stat.Proposed fix
storeSessionParseCacheEntry(file.path, { - mtimeMs: file.mtimeMs, + mtimeMs: file.contentDependencyRefused ? UNMATCHABLE_MTIME_MS : file.mtimeMs, sizeBytes: file.sizeBytes ?? null,
ℹ️ Review info
⚙️ Run configuration
Configuration used: Repository UI
Review profile: CHILL
Plan: Advanced
Run ID: 33e29416-40c0-4acd-a19c-e89631ebadf4
📒 Files selected for processing (6)
src/main/ai-vault/session-scanner-cursor-chat-meta.test.tssrc/main/ai-vault/session-scanner-discovery.tssrc/main/ai-vault/session-scanner-parse-cache.tssrc/main/ai-vault/session-scanner-types.tssrc/main/ai-vault/session-transcript-consumers.test.tssrc/main/ai-vault/session-transcript-reader.ts
Included review availability: Your plan provides up to 10 included reviews per hour; 5 remain after this review.
There was a problem hiding this comment.
Important
One cache-honesty gap remains in the new refused-dependency path, noted inline: the whole-file branch ignores contentDependencyRefused, unlike the resumable branch.
Reviewed changes
- Transcript size separated from the cache key —
FileWithMtimenow carriesdependencySizeBytes(andcontentDependencyRefused), andtranscriptSizeBytessubtracts the content dependency so a resume or whole-file byte offset is compared against the transcript's own length, closing the window where a truncation smaller than Cursor'smeta.jsonwas silently tolerated. - Refused dependency stat degrades instead of dropping —
optionalContentDependencyStatreturns'refused'rather than throwing, the transcript is still listed withcontentDependencyRefused, and one issue is recorded per root; the resumable cache path stores such entries under anUNMATCHABLE_MTIME_MS = -1key so the resume cursor survives while the key never reads as unchanged. - Behavioral tests — three new Cursor cases (sub-sibling truncation re-read, poisoned-key resume preservation, refused-stat list-then-heal) plus a Cline whole-file byte-offset assertion, each failing with its fix reverted.
DeepSeek Pro (free via Pullfrog for OSS) | 𝕏
…nscript Folding Cursor's meta.json stat into the transcript's mtime/size made one key mean two things, and every round of review found another consequence: a byte offset could not be compared against it, a refused sibling read took the transcript down with it, and an un-enriched parse cached under it looked current forever. Main already had the answer for a file the transcript key cannot see: Codex titles are refreshed at reuse time over the cached session, not folded into the key. Discovery now records the sibling as its own observation, unknown when it could not be read. A cache hit needs both the transcript key and the sidecar to match. When only the sidecar moved, Cursor re-merges it over the stored un-enriched fold result and never re-reads the transcript; Cline, which reads its sibling as part of the parse, re-parses. Merging over the fold result rather than the accumulator makes enrichment pure, so a meta.json rewritten with a new cwd replaces the old one instead of losing to it. That was unreachable while the merge used ??= on a session it had already enriched. Cline and the remote scanner move to the same field, so the fold is gone from both discovery paths.
Round 4: Cursor sidecar tracked apart from the transcript (design change)Three review rounds produced seven findings that all traced to one root: discovery folded the Cursor
Shape
Verification (rerun by the lead, not the worker)
|
There was a problem hiding this comment.
✅ No new issues found.
Reviewed changes
- Sidecar observation replaces the folded cache key —
FileWithMtimedropsdependencySizeBytes/contentDependencyRefusedfor a tri-statesidecar(stat | 'none' | 'unknown',session-sidecar-stat.ts), sosizeBytesis again the transcript's own length and a refused sibling no longer poisons the key. - Cursor enrichment moves out of the fold —
session-scanner-sidecar-enrichment.tsmerges ameta.jsononto the transcript-only fold as a pure(fold, sibling)function, re-run on a sibling-only change without re-reading bytes, and rebuilds theresumeCommandwhencwdchanges. - Whole-file cache-honesty gap closed — the parse-cache entry gains
foldSession(in-memory) andsidecar; a refused sibling is stored as'unknown', whichsidecarUnchangednever treats as unchanged, so the whole-file branch re-parses instead of reusing a stale entry. This resolves the priorcontentDependencyRefusedfinding. - Remote cache adopts the same model —
remote-session-parse-cache.ts/ discovery recordsidecarbeside the transcript stat instead of folding mtime/size. - Behavioral tests — Cline whole-file sidecar re-parse, Cursor sidecar-only re-enrichment (a rewritten
cwdreplaces the merged one), refused-sidecar resume survival, and thesidecarUnchangedtri-state semantics, each failing with its fix reverted.
The sidecar split is a clean generalization: it makes the resume byte-offset check compare against the transcript's own length, keeps a refused sibling from taking the session down, and applies the same cache-honesty treatment to both resumable and whole-file branches that the earlier commits only gave to the resumable path.
DeepSeek Pro (free via Pullfrog for OSS) | 𝕏
Three places collapsed the two. sidecarUnchanged returned true for any observed 'none' without reading the entry, so a sidecar that was deleted, or one that was unreadable last scan, both read as cache hits. Native discovery mapped every non-WSL stat failure to 'none', so an EACCES on meta.json left a session enriched from a file nobody can see, with no scan issue. Remote discovery could not tell a missing sibling from a failed stat, because statRemoteSessionFile returns null for both. 'none' is now a claim: absent-now is a hit only when it was absent before or the agent never had a sidecar, and only ENOENT/ENOTDIR reads as absent. statRemoteSessionFile grows an opt-in rethrow so its caller can distinguish the two failures it already reports. Also rewrites three comments in the cursor chat-meta reader that still described the deleted fold.
Round 4 review of d918be1 → c08d929An Opus adversarial review of the design-B commit found no P0 and two real holes, both on the "sidecar is absent" side. Fixed in Findings and fixes
Mutations (rerun by the lead): deleting the remote Gates: tc, tc:node, ai-vault + ports tests (92 files, 712 tests), both changed-code gates, native audit: all pass. Scope correction: the PR body previously listed per-path parse serialization as out of scope. It is in this PR ( Earlier CI failure on d918be1: one shard failed |
There was a problem hiding this comment.
✅ No new issues found.
Reviewed changes
- Local sidecar: missing vs unreadable —
isMissingSidecarErrornarrows'none'to a genuineENOENT/ENOTDIR, so anEACCES/EIO/WSL-stall now records'unknown'instead of reading as "no sidecar";sidecarUnchangedadditionally treats a vanished sidecar as a change rather than a cache hit. - Remote sidecar: missing vs unreadable —
statRemoteSessionFilegainsrethrowFailures, andobserveRemoteSidecarmaps a non-missing stat failure to'unknown', closing the bi-state gap where a failed remote sidecar stat collapsed to'none'and reused a stale row. - Behavioral tests — remote re-parse-on-failed-stat, local
EACCES→'unknown'→ heal, the expandedsidecarUnchangedtruth table, and a persistence round-trip covering all three observations.
The distinction is correct on both branches. On the WSL path a genuinely missing file is reconstructed by the helper process with its ENOENT code (not wrapped in WslTranscriptFsError), so 'none' remains the missing-file verdict while gate refusals stay 'unknown'. The tests fail with their fixes reverted.
DeepSeek Pro (free via Pullfrog for OSS) | 𝕏

Summary
First of a stacked split of #18112 (agent session search). This PR only restructures the existing ai-vault scanner so a second reader of the same transcripts can be added later without touching the scanner. Nothing user-visible changes except Cursor sessions gaining a workspace and timestamps.
Reader / consumer split. The scanner's only output was the Session History summary, so any other reader of transcripts had to hook the parse itself. Now:
session-transcript-reader.tsowns each file read: resume from the byte cursor when the file only grew and the offset sits on a line boundary, otherwise re-read whole; drive the parser; report where the read ended.session-transcript-channel.tsfans every decoded message out per read.session-transcript-consumers.tsis the registry. A consumer opts in per read withbeginRead(start), receivesmessage(...)calls, and getsfinish({ byteOffset, incomplete }). Consumers keep their own cursor and never query each other.TranscriptMessageSinkparameter instead of a module-global scope.Also in this PR
chats/<md5 of cwd>/<uuid>/meta.jsonfor cwd, title, timestamps. Cursor transcripts carry only role and message, so these sessions had no workspace match before. Local file reads only; SSH content parses opt out.LazyWorkerThreadHost(shared with the port-scan probe) and probe the schema before querying so a changed OpenCode layout degrades instead of throwing mid-read.session_metafield readers split into their own module (the file was at the line limit).Deliberately not in this PR (later PRs in the stack): any search index or FTS table, inode identity on resume points, a Codex state-DB metadata fallback.
Verification
pnpm tc,tc:node;src/main+src/sharedtests (4,056 files / 41,347 tests);check:code-quality:changedandcheck:react-doctor:changed, 0 new findings.origin/main(e80fae0): fixture scans for all 18 providers cold, 8 resumable providers appended with an unterminated last line, and one Cursor transcript with ameta.json. 26 of 27 sessions byte-identical. The Cursor session gainscwd,createdAt,updatedAt, and acdprefix onresumeCommand; title unchanged.session-transcript-consumers.test.ts: two independent consumers receive the same 12-message stream; append-mode replays only new lines; a trailing unterminated line is published once; a throwing or declining consumer does not affect the list.Not verified: WSL and SSH equivalence (fixtures ran on macOS).