From 839ad2f2ceecfe02964527a77e85c64b8d21a3d4 Mon Sep 17 00:00:00 2001 From: waleed Date: Mon, 4 May 2026 10:37:20 -0700 Subject: [PATCH 1/2] fix(executor): strip childTraceSpans from block state before LLM tool calls --- apps/sim/executor/execution/block-executor.ts | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/apps/sim/executor/execution/block-executor.ts b/apps/sim/executor/execution/block-executor.ts index 340b2aab01a..30239a806d1 100644 --- a/apps/sim/executor/execution/block-executor.ts +++ b/apps/sim/executor/execution/block-executor.ts @@ -187,7 +187,8 @@ export class BlockExecutor { } } - this.state.setBlockOutput(node.id, normalizedOutput, duration) + const { childTraceSpans: _traces, ...outputForState } = normalizedOutput + this.state.setBlockOutput(node.id, outputForState as NormalizedBlockOutput, duration) if (!isSentinel && blockLog) { const childWorkflowInstanceId = @@ -270,7 +271,6 @@ export class BlockExecutor { } if (ChildWorkflowError.isChildWorkflowError(error)) { - errorOutput.childTraceSpans = error.childTraceSpans errorOutput.childWorkflowName = error.childWorkflowName if (error.childWorkflowSnapshotId) { errorOutput.childWorkflowSnapshotId = error.childWorkflowSnapshotId @@ -287,8 +287,8 @@ export class BlockExecutor { blockLog.input = this.sanitizeInputsForLog(input) blockLog.output = filterOutputForLog(block.metadata?.id || '', errorOutput, { block }) - if (errorOutput.childTraceSpans && Array.isArray(errorOutput.childTraceSpans)) { - blockLog.childTraceSpans = errorOutput.childTraceSpans + if (ChildWorkflowError.isChildWorkflowError(error) && error.childTraceSpans.length > 0) { + blockLog.childTraceSpans = error.childTraceSpans } } From 293c1f9e3e3242f3551058d456fe7c6b7f60fad4 Mon Sep 17 00:00:00 2001 From: waleed Date: Mon, 4 May 2026 10:44:10 -0700 Subject: [PATCH 2/2] fix(executor): return stripped output so orchestrator setBlockOutput stays clean --- apps/sim/executor/execution/block-executor.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/apps/sim/executor/execution/block-executor.ts b/apps/sim/executor/execution/block-executor.ts index 30239a806d1..9a3c22e8529 100644 --- a/apps/sim/executor/execution/block-executor.ts +++ b/apps/sim/executor/execution/block-executor.ts @@ -212,7 +212,7 @@ export class BlockExecutor { ) } - return normalizedOutput + return outputForState as NormalizedBlockOutput } catch (error) { return await this.handleBlockError( error,