Skip to content

removeThreadState

removeThreadState(storePath, threadIds, options?): ReclaimSummary

Defined in: packages/core/src/history/checkpointRetention.ts:471

Remove every checkpoint and pending write of the named threads, and report what went. Each thread’s file is deleted whole; a file that also holds a conversation record is stripped of its checkpoint state inside one transaction (both tables or neither) and vacuumed instead. See the module note.

beforeRemove is called with each thread id before its file is touched, so a caller holding a connection to it can close it first: on win32 an open file cannot be deleted. A file that still cannot be deleted is stripped instead, so its bytes are released either way.

Never throws. A thread whose removal failed is not counted.

string

readonly string[]

(threadId) => void

ReclaimSummary