MCPcopy Create free account
hub / github.com/AnukarOP/claude-code-leaked / kill

Function kill

source code/tasks/DreamTask/DreamTask.ts:138–158  ·  view source on GitHub ↗
(taskId, setAppState)

Source from the content-addressed store, hash-verified

136 type: 'dream',
137
138 async kill(taskId, setAppState) {
139 let priorMtime: number | undefined
140 updateTaskState<DreamTaskState>(taskId, setAppState, task => {
141 if (task.status !== 'running') return task
142 task.abortController?.abort()
143 priorMtime = task.priorMtime
144 return {
145 ...task,
146 status: 'killed',
147 endTime: Date.now(),
148 notified: true,
149 abortController: undefined,
150 }
151 })
152 // Rewind the lock mtime so the next session can retry. Same path as the
153 // fork-failure catch in autoDream.ts. If updateTaskState was a no-op
154 // (already terminal), priorMtime stays undefined and we skip.
155 if (priorMtime !== undefined) {
156 await rollbackConsolidationLock(priorMtime)
157 }
158 },
159}

Callers

nothing calls this directly

Calls 2

updateTaskStateFunction · 0.50

Tested by

no test coverage detected