* Filter active workflow run IDs down to those whose persisted attention * policy still blocks the owner's turn-end. `notify_on_terminal` runs are * non-blocking; their terminal result is delivered via the existing * AIService background-run terminal continuation.
(
workspaceId: string,
runIds: string[]
)
| 6734 | * AIService background-run terminal continuation. |
| 6735 | */ |
| 6736 | private async listBlockingWorkflowRunIds( |
| 6737 | workspaceId: string, |
| 6738 | runIds: string[] |
| 6739 | ): Promise<string[]> { |
| 6740 | if (runIds.length === 0) { |
| 6741 | return []; |
| 6742 | } |
| 6743 | const runStore = new WorkflowRunStore({ |
| 6744 | sessionDir: this.config.getSessionDir(workspaceId), |
| 6745 | }); |
| 6746 | const blocking: string[] = []; |
| 6747 | for (const runId of runIds) { |
| 6748 | const run = await runStore.getRun(runId).catch(() => null); |
| 6749 | if (resolveBackgroundWorkAttentionPolicy(run?.attentionPolicy) !== "notify_on_terminal") { |
| 6750 | blocking.push(runId); |
| 6751 | } |
| 6752 | } |
| 6753 | return blocking; |
| 6754 | } |
| 6755 | |
| 6756 | private async listActiveWorkflowRunIdsForWorkspace(workspaceId: string): Promise<string[]> { |
| 6757 | assert(workspaceId.length > 0, "listActiveWorkflowRunIdsForWorkspace requires workspaceId"); |
no test coverage detected