MCPcopy Index your code
hub / github.com/coder/mux / enqueueWorkflowRunTerminalAttention

Method enqueueWorkflowRunTerminalAttention

src/node/services/taskService.ts:4321–4341  ·  view source on GitHub ↗

* Persist a pending terminal wake-up for the owner workspace and schedule an async drain. * Idempotent by source kind/id. Must NOT be called while holding settlement/event locks; only * the persisted enqueue happens synchronously inside callers, the drain is deferred.

(params: {
    ownerWorkspaceId: string;
    runId: string;
    status: WorkflowRunStatus;
  })

Source from the content-addressed store, hash-verified

4319 * the persisted enqueue happens synchronously inside callers, the drain is deferred.
4320 */
4321 async enqueueWorkflowRunTerminalAttention(params: {
4322 ownerWorkspaceId: string;
4323 runId: string;
4324 status: WorkflowRunStatus;
4325 }): Promise<void> {
4326 assert(
4327 params.ownerWorkspaceId.length > 0,
4328 "enqueueWorkflowRunTerminalAttention requires ownerWorkspaceId"
4329 );
4330 assert(params.runId.length > 0, "enqueueWorkflowRunTerminalAttention requires runId");
4331 if (!isTerminalWorkflowRunStatus(params.status)) {
4332 return;
4333 }
4334 await this.enqueueTerminalAttention({
4335 ownerWorkspaceId: params.ownerWorkspaceId,
4336 sourceKind: "workflow_run",
4337 sourceId: params.runId,
4338 outputDelivery: "workflow_result_context",
4339 terminalOutcome: workflowRunTerminalOutcome(params.status),
4340 });
4341 }
4342
4343 async resetWorkflowRunTerminalAttention(params: {
4344 ownerWorkspaceId: string;

Callers 2

streamMessageMethod · 0.80

Calls 4

assertFunction · 0.50

Tested by

no test coverage detected