(taskId, setAppState)
| 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 | } |
nothing calls this directly
no test coverage detected