Skip to content

Commit 9caf2a3

Browse files
committed
fix abort signal passthrough
1 parent 7961989 commit 9caf2a3

3 files changed

Lines changed: 8 additions & 3 deletions

File tree

apps/sim/app/api/resume/[workflowId]/[executionId]/[contextId]/route.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -176,11 +176,12 @@ export async function POST(
176176
timeoutMs: preprocessResult.executionTimeout?.sync,
177177
},
178178
executionId: enqueueResult.resumeExecutionId,
179-
executeFn: async ({ onStream, onBlockComplete }) =>
179+
executeFn: async ({ onStream, onBlockComplete, abortSignal }) =>
180180
PauseResumeManager.startResumeExecution({
181181
...resumeArgs,
182182
onStream,
183183
onBlockComplete,
184+
abortSignal,
184185
}),
185186
})
186187

apps/sim/lib/workflows/executor/human-in-the-loop-manager.ts

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -114,6 +114,7 @@ interface StartResumeExecutionArgs {
114114
sendEvent?: (event: ExecutionEvent) => void
115115
onStream?: (streamingExec: StreamingExecution) => Promise<void>
116116
onBlockComplete?: (blockId: string, output: unknown) => Promise<void>
117+
abortSignal?: AbortSignal
117118
}
118119

119120
export class PauseResumeManager {
@@ -306,6 +307,7 @@ export class PauseResumeManager {
306307
sendEvent,
307308
onStream,
308309
onBlockComplete,
310+
abortSignal,
309311
} = args
310312

311313
const pausePointsRecord = pausedExecution.pausePoints as Record<string, any>
@@ -324,6 +326,7 @@ export class PauseResumeManager {
324326
sendEvent,
325327
onStream,
326328
onBlockComplete,
329+
abortSignal,
327330
})
328331

329332
if (result.status === 'paused') {
@@ -402,6 +405,7 @@ export class PauseResumeManager {
402405
sendEvent?: (event: ExecutionEvent) => void
403406
onStream?: (streamingExec: StreamingExecution) => Promise<void>
404407
onBlockComplete?: (blockId: string, output: unknown) => Promise<void>
408+
abortSignal?: AbortSignal
405409
}): Promise<ExecutionResult> {
406410
const {
407411
resumeExecutionId,
@@ -412,6 +416,7 @@ export class PauseResumeManager {
412416
sendEvent,
413417
onStream: externalOnStream,
414418
onBlockComplete: externalOnBlockComplete,
419+
abortSignal: externalAbortSignal,
415420
} = args
416421
const parentExecutionId = pausedExecution.executionId
417422

@@ -1000,7 +1005,7 @@ export class PauseResumeManager {
10001005
skipLogCreation: true,
10011006
includeFileBase64: true,
10021007
base64MaxBytes: undefined,
1003-
abortSignal: timeoutController.signal,
1008+
abortSignal: externalAbortSignal ?? timeoutController.signal,
10041009
})
10051010

10061011
if (

bun.lock

Lines changed: 0 additions & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)