( taskId: string, setAppState: SetAppState, )
| 106 | } |
| 107 | |
| 108 | export function completeDreamTask( |
| 109 | taskId: string, |
| 110 | setAppState: SetAppState, |
| 111 | ): void { |
| 112 | // notified: true immediately — dream has no model-facing notification path |
| 113 | // (it's UI-only), and eviction requires terminal + notified. The inline |
| 114 | // appendSystemMessage completion note IS the user surface. |
| 115 | updateTaskState<DreamTaskState>(taskId, setAppState, task => ({ |
| 116 | ...task, |
| 117 | status: 'completed', |
| 118 | endTime: Date.now(), |
| 119 | notified: true, |
| 120 | abortController: undefined, |
| 121 | })) |
| 122 | } |
| 123 | |
| 124 | export function failDreamTask(taskId: string, setAppState: SetAppState): void { |
| 125 | updateTaskState<DreamTaskState>(taskId, setAppState, task => ({ |
no test coverage detected