Skip to content

selectPrunableConversations

selectPrunableConversations(storePath, bounds): PrunableConversation[]

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

The conversations gth history prune would remove the stored state of, newest activity first.

A conversation qualifies when it still names a thread that has checkpoints (there is something to remove) and it satisfies every bound given. olderThanDays and keepLast therefore compose as a conjunction: with both, a conversation is pruned only when it is older than the age AND outside the newest N. Passing neither selects nothing — the command requires an explicit bound, so that there is no silent default for an operation that can cost a resume.

Neither of the automatic pass’s two guards applies here, and that is the design. The bounds the person typed are the whole selection; what this does instead is say so — PrunableConversation.recentlyActive marks every candidate whose last turn is inside RECLAIM_GRACE_MS, the plan prints that marker, and the command asks before removing anything.

string

PruneBounds

PrunableConversation[]