Skip to content

Commit dc6e3f3

Browse files
waleedlatif1claude
andcommitted
fix(terminal): wire copilot cancellation to finalBlockLogs reconciliation
Address Greptile review: - `executeWorkflowWithFullLogging`'s `onExecutionCancelled` was `() => {}` and silently dropped the `finalBlockLogs` payload, so Bug 2's "upstream blocks stuck on Running" fix did not fire on copilot-initiated cancellations. Wire it through `handleExecutionCancelledConsole` to match the SSE-route `onExecutionCancelled` path. - Test for the `blockType !== 'error'` filter used a different `executionId` than the seeded entry, so the executionId scope rejected the entry before the blockType predicate ran. Align executionIds so the test actually exercises the filter. Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
1 parent 58e86c5 commit dc6e3f3

2 files changed

Lines changed: 12 additions & 2 deletions

File tree

apps/sim/app/workspace/[workspaceId]/w/[workflowId]/utils/workflow-execution-utils.test.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -95,7 +95,7 @@ describe('workflow-execution-utils', () => {
9595
const addConsole = vi.fn()
9696
addExecutionErrorConsoleEntry(addConsole, {
9797
workflowId: 'wf-1',
98-
executionId: 'exec-2',
98+
executionId: 'exec-1',
9999
error: 'New run failed',
100100
blockLogs: [],
101101
})

apps/sim/app/workspace/[workspaceId]/w/[workflowId]/utils/workflow-execution-utils.ts

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -814,14 +814,24 @@ export async function executeWorkflowWithFullLogging(
814814
}
815815
},
816816

817-
onExecutionCancelled: () => {
817+
onExecutionCancelled: (data) => {
818818
setCurrentExecutionId(wfId, null)
819819
executionResult = {
820820
success: false,
821821
output: {},
822822
error: 'Run was cancelled',
823823
logs: accumulatedBlockLogs,
824824
}
825+
826+
handleExecutionCancelledConsole(
827+
{ addConsole, updateConsole, cancelRunningEntries },
828+
{
829+
workflowId: wfId,
830+
executionId: executionIdRef.current,
831+
durationMs: data?.duration,
832+
finalBlockLogs: data?.finalBlockLogs,
833+
}
834+
)
825835
},
826836

827837
onExecutionError: (data) => {

0 commit comments

Comments
 (0)