Summary
TranscriptsStore.readUtterancesFromDir in src/transcripts/store.ts creates createReadStream and readline.createInterface for streaming JSONL parsing, but does not clean them up after use. If JSON.parse throws inside the async iteration loop, the underlying file descriptor remains open.
Reproduction
Source inspection: lines 199-201 create createReadStream and createInterface without lines.close() or stream.destroy() on error exit.
Expected
Wrap the for await loop in try/finally that calls lines.close() and stream.destroy().
Scope
src/transcripts/store.ts:199-232 — 1 file, ~6 LoC change.
Summary
TranscriptsStore.readUtterancesFromDirinsrc/transcripts/store.tscreatescreateReadStreamandreadline.createInterfacefor streaming JSONL parsing, but does not clean them up after use. IfJSON.parsethrows inside the async iteration loop, the underlying file descriptor remains open.Reproduction
Source inspection: lines 199-201 create
createReadStreamandcreateInterfacewithoutlines.close()orstream.destroy()on error exit.Expected
Wrap the
for awaitloop intry/finallythat callslines.close()andstream.destroy().Scope
src/transcripts/store.ts:199-232— 1 file, ~6 LoC change.