* Atomically mark a task as notified. Returns true if this call flipped the * flag (caller should enqueue), false if already notified (caller should skip).
(taskId: string, setAppState: SetAppState)
| 194 | * flag (caller should enqueue), false if already notified (caller should skip). |
| 195 | */ |
| 196 | function markTaskNotified(taskId: string, setAppState: SetAppState): boolean { |
| 197 | let shouldEnqueue = false; |
| 198 | updateTaskState<RemoteAgentTaskState>(taskId, setAppState, task => { |
| 199 | if (task.notified) { |
| 200 | return task; |
| 201 | } |
| 202 | shouldEnqueue = true; |
| 203 | return { |
| 204 | ...task, |
| 205 | notified: true |
| 206 | }; |
| 207 | }); |
| 208 | return shouldEnqueue; |
| 209 | } |
| 210 | |
| 211 | /** |
| 212 | * Extract the plan content from the remote session log. |
no test coverage detected