Skip to content

Commit 02e5224

Browse files
committed
address comments
1 parent d49e12e commit 02e5224

2 files changed

Lines changed: 5 additions & 21 deletions

File tree

apps/sim/executor/orchestrators/parallel.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -516,6 +516,7 @@ export class ParallelOrchestrator {
516516

517517
prepareForBatchContinuation(parallelId: string): void {
518518
this.state.unmarkExecuted(buildParallelSentinelStartId(parallelId))
519+
this.state.unmarkExecuted(buildParallelSentinelEndId(parallelId))
519520
this.state.deleteBlockState(buildParallelSentinelEndId(parallelId))
520521
}
521522

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

Lines changed: 4 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -47,22 +47,10 @@ function isRecord(value: unknown): value is Record<string, unknown> {
4747
return value !== null && typeof value === 'object' && !Array.isArray(value)
4848
}
4949

50-
function isPausedOutputForContext(
51-
output: unknown,
52-
stateBlockKey: string,
53-
pauseBlockId: string,
54-
contextId: string
55-
): boolean {
50+
function isPausedOutputForContext(output: unknown, contextId: string): boolean {
5651
if (!isRecord(output)) return false
5752
const metadata = output._pauseMetadata
58-
if (isRecord(metadata)) {
59-
return (
60-
metadata.contextId === contextId ||
61-
metadata.blockId === stateBlockKey ||
62-
metadata.blockId === pauseBlockId
63-
)
64-
}
65-
return false
53+
return isRecord(metadata) && metadata.contextId === contextId
6654
}
6755

6856
function updateResumeOutputInAggregationBuffers(
@@ -76,13 +64,8 @@ function updateResumeOutputInAggregationBuffers(
7664
if (!isRecord(scope) || !isRecord(scope.currentIterationOutputs)) continue
7765

7866
const outputs = scope.currentIterationOutputs
79-
if (
80-
outputs[stateBlockKey] !== undefined ||
81-
outputs[pauseBlockId] !== undefined ||
82-
outputs[contextId] !== undefined
83-
) {
67+
if (outputs[stateBlockKey] !== undefined || outputs[pauseBlockId] !== undefined) {
8468
delete outputs[pauseBlockId]
85-
delete outputs[contextId]
8669
outputs[stateBlockKey] = mergedOutput
8770
}
8871
}
@@ -94,7 +77,7 @@ function updateResumeOutputInAggregationBuffers(
9477
if (!Array.isArray(branchOutputs)) continue
9578

9679
const outputIndex = branchOutputs.findIndex((output) =>
97-
isPausedOutputForContext(output, stateBlockKey, pauseBlockId, contextId)
80+
isPausedOutputForContext(output, contextId)
9881
)
9982
if (outputIndex !== -1) {
10083
scope.branchOutputs[branchIndex] = [

0 commit comments

Comments
 (0)