Skip to content

transcripts: file descriptor leak in readUtterancesFromDir stream cleanup #98467

Description

@zhangLei99586

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    P2Normal backlog priority with limited blast radius.clawsweeper:source-reproClawSweeper found a high-confidence source-level issue reproduction.impact:crash-loopCrash, hang, restart loop, or process-level availability failure.issue-rating: 🦞 diamond lobsterVery strong issue quality with high-confidence source-level or clear reproduction.

    Type

    No type

    Fields

    Priority

    None yet

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions