MCPcopy Create free account
hub / github.com/MigoXLab/coderio / checkpointExists

Function checkpointExists

src/utils/checkpoint.ts:10–20  ·  view source on GitHub ↗

* Check if a checkpoint exists for the given thread_id

(checkpointer: SqliteSaver, threadId: string)

Source from the content-addressed store, hash-verified

8 * Check if a checkpoint exists for the given thread_id
9 */
10async function checkpointExists(checkpointer: SqliteSaver, threadId: string): Promise<boolean> {
11 try {
12 const checkpoints = checkpointer.list({ configurable: { thread_id: threadId } }, { limit: 1 });
13 const firstCheckpoint = await checkpoints.next();
14 return !firstCheckpoint.done && firstCheckpoint.value !== undefined;
15 } catch (error) {
16 const errorMessage = error instanceof Error ? error.message : String(error);
17 logger.printTestLog(`Error checking checkpoint: ${errorMessage}`);
18 return false;
19 }
20}
21
22/**
23 * Clear checkpoint for the given thread_id

Callers 1

promptCheckpointChoiceFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected