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