(
workspace: WorkspaceConfigEntry
)
| 1420 | } |
| 1421 | |
| 1422 | private applyInterruptedTaskStatus( |
| 1423 | workspace: WorkspaceConfigEntry |
| 1424 | ): InterruptedTaskStatusMutation { |
| 1425 | if (hasCompletedAgentReport(workspace)) { |
| 1426 | // Preserve completed report evidence so already-finished tasks stay inspectable |
| 1427 | // and collapse-eligible after a later interrupt/recovery pass. |
| 1428 | return "preserved-completed-report"; |
| 1429 | } |
| 1430 | |
| 1431 | const previousStatus = workspace.taskStatus; |
| 1432 | const persistedQueuedPrompt = coerceNonEmptyString(workspace.taskPrompt); |
| 1433 | workspace.taskStatus = "interrupted"; |
| 1434 | workspace.reportedAt = undefined; |
| 1435 | |
| 1436 | // Queued tasks persist their initial prompt in config until first start. Preserve that |
| 1437 | // intent across interrupts, including repeated interrupts after the status is no longer queued. |
| 1438 | if (previousStatus !== "queued" && !persistedQueuedPrompt) { |
| 1439 | workspace.taskPrompt = undefined; |
| 1440 | } |
| 1441 | return "interrupted"; |
| 1442 | } |
| 1443 | |
| 1444 | private async interruptTaskRecoveryForInactiveWorkflowOwner( |
| 1445 | taskId: string, |
no test coverage detected