From 22f949a41c9148a4232b2c76286e72940e644527 Mon Sep 17 00:00:00 2001 From: Waleed Date: Tue, 6 Jan 2026 12:52:40 -0800 Subject: [PATCH] fix(condition): added success check on condition block processor, fixed terminal preventDefault copy bug (#2691) --- .../[workspaceId]/w/[workflowId]/workflow.tsx | 7 +++++++ apps/sim/tools/function/execute.ts | 11 +++++++++++ 2 files changed, 18 insertions(+) diff --git a/apps/sim/app/workspace/[workspaceId]/w/[workflowId]/workflow.tsx b/apps/sim/app/workspace/[workspaceId]/w/[workflowId]/workflow.tsx index be6c11ef0..853cd544f 100644 --- a/apps/sim/app/workspace/[workspaceId]/w/[workflowId]/workflow.tsx +++ b/apps/sim/app/workspace/[workspaceId]/w/[workflowId]/workflow.tsx @@ -795,6 +795,13 @@ const WorkflowContent = React.memo(() => { event.preventDefault() redo() } else if ((event.ctrlKey || event.metaKey) && event.key === 'c') { + const selection = window.getSelection() + const hasTextSelection = selection && selection.toString().length > 0 + + if (hasTextSelection) { + return + } + const selectedNodes = getNodes().filter((node) => node.selected) if (selectedNodes.length > 0) { event.preventDefault() diff --git a/apps/sim/tools/function/execute.ts b/apps/sim/tools/function/execute.ts index f5c697721..516c70127 100644 --- a/apps/sim/tools/function/execute.ts +++ b/apps/sim/tools/function/execute.ts @@ -90,6 +90,17 @@ export const functionExecuteTool: ToolConfig => { const result = await response.json() + if (!result.success) { + return { + success: false, + output: { + result: null, + stdout: result.output?.stdout || '', + }, + error: result.error, + } + } + return { success: true, output: {