(task: AgentTaskWorkspaceEntry)
| 6812 | } |
| 6813 | |
| 6814 | private isActiveAgentTaskEntry(task: AgentTaskWorkspaceEntry): boolean { |
| 6815 | const status: AgentTaskStatus = task.taskStatus ?? "running"; |
| 6816 | if (!ACTIVE_AGENT_TASK_STATUSES.has(status)) { |
| 6817 | return false; |
| 6818 | } |
| 6819 | |
| 6820 | // Archiving a task stops its stream but intentionally leaves taskStatus untouched in |
| 6821 | // persisted config. Treat archived, non-streaming tasks as inactive so stale status cannot |
| 6822 | // keep ancestors/workspace-turn handles blocked forever. |
| 6823 | if (isWorkspaceArchived(task.archivedAt, task.unarchivedAt)) { |
| 6824 | return task.id != null && this.aiService.isStreaming(task.id); |
| 6825 | } |
| 6826 | |
| 6827 | return true; |
| 6828 | } |
| 6829 | |
| 6830 | private countActiveAgentTasks(config: ReturnType<Config["loadConfigOrDefault"]>): number { |
| 6831 | let activeCount = 0; |
no test coverage detected