MCPcopy
hub / github.com/coder/mux / isActiveAgentTaskEntry

Method isActiveAgentTaskEntry

src/node/services/taskService.ts:6814–6828  ·  view source on GitHub ↗
(task: AgentTaskWorkspaceEntry)

Source from the content-addressed store, hash-verified

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;

Calls 3

isWorkspaceArchivedFunction · 0.90
hasMethod · 0.45
isStreamingMethod · 0.45

Tested by

no test coverage detected