MCPcopy Create free account
hub / github.com/IgorWarzocha/howcode / loadThread

Function loadThread

desktop/pi-threads/thread-loader.ts:95–108  ·  view source on GitHub ↗
(
  sessionPath: string,
  options?: { historyCompactions?: number | undefined },
)

Source from the content-addressed store, hash-verified

93}
94
95export async function loadThread(
96 sessionPath: string,
97 options?: { historyCompactions?: number | undefined },
98): Promise<ThreadData> {
99 const liveThread = getLiveThread(sessionPath)
100 if (
101 (liveThread?.isStreaming || liveThread?.isCompacting) &&
102 (options?.historyCompactions ?? 0) === 0
103 ) {
104 return attachThreadDiffPreferences(liveThread)
105 }
106
107 return (await loadThreadSnapshot(sessionPath, options)).thread
108}

Callers 1

loadInboxThreadListFunction · 0.85

Calls 3

getLiveThreadFunction · 0.90
loadThreadSnapshotFunction · 0.70

Tested by

no test coverage detected