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

Function deletePersistedThread

desktop/pi-threads/thread-actions.ts:27–49  ·  view source on GitHub ↗
(threadId: string)

Source from the content-addressed store, hash-verified

25import { handledAction, unhandledAction } from './action-router-result.ts'
26
27async function deletePersistedThread(threadId: string) {
28 const sessionPath = getThreadSessionPath(threadId)
29 if (sessionPath) {
30 try {
31 await unlink(sessionPath)
32 } catch (error) {
33 if (
34 typeof error !== 'object' ||
35 error === null ||
36 !('code' in error) ||
37 error.code !== 'ENOENT'
38 ) {
39 throw error
40 }
41 }
42 }
43
44 if (sessionPath) {
45 deleteArtifactsForConversation(sessionPath)
46 deleteChatThread(sessionPath)
47 }
48 deleteThreadRecord(threadId)
49}
50
51async function deletePersistedThreads(threadIds: string[]) {
52 const deletedThreadIds: string[] = []

Callers 2

deletePersistedThreadsFunction · 0.85
thread-actions.tsFile · 0.85

Calls 4

getThreadSessionPathFunction · 0.90
deleteChatThreadFunction · 0.90
deleteThreadRecordFunction · 0.90

Tested by

no test coverage detected