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

Method markWorkflowRunEnded

src/node/services/taskService.ts:3793–3812  ·  view source on GitHub ↗

Best-effort final recheck for any completed workflow children still deferred by cleanup gates.

(workflowRunId: string)

Source from the content-addressed store, hash-verified

3791
3792 /** Best-effort final recheck for any completed workflow children still deferred by cleanup gates. */
3793 async markWorkflowRunEnded(workflowRunId: string): Promise<void> {
3794 assert(workflowRunId.length > 0, "markWorkflowRunEnded: workflowRunId must be non-empty");
3795
3796 const cfg = this.config.loadConfigOrDefault();
3797 const completedTaskIds: string[] = [];
3798 for (const project of cfg.projects.values()) {
3799 for (const workspace of project.workspaces) {
3800 if (
3801 workspace.id &&
3802 workspace.workflowTask?.runId === workflowRunId &&
3803 hasCompletedAgentReport(workspace)
3804 ) {
3805 completedTaskIds.push(workspace.id);
3806 }
3807 }
3808 }
3809 for (const taskId of completedTaskIds) {
3810 await this.cleanupReportedLeafTask(taskId);
3811 }
3812 }
3813
3814 /**
3815 * Interrupt all descendant agent tasks for a workspace (leaf-first).

Callers

nothing calls this directly

Calls 5

hasCompletedAgentReportFunction · 0.90
loadConfigOrDefaultMethod · 0.80
pushMethod · 0.65
assertFunction · 0.50

Tested by

no test coverage detected