From 8579beb1996731538eb34279ec7a13c4e6e6348a Mon Sep 17 00:00:00 2001 From: Waleed Date: Wed, 4 Mar 2026 19:05:45 -0800 Subject: [PATCH] fix(chat): use explicit trigger type check instead of heuristic for chat guard (#3419) * fix(chat): use explicit trigger type check instead of heuristic for chat guard * fix(chat): remove heuristic fallback from isExecutingFromChat Use only overrideTriggerType === 'chat' instead of also checking for 'input' in workflowInput, which can false-positive on manual executions with workflow input. * fix(chat): use isExecutingFromChat variable consistently in callbacks Replace inline overrideTriggerType !== 'chat' checks with !isExecutingFromChat to stay consistent with the rest of the function. --- .../w/[workflowId]/hooks/use-workflow-execution.ts | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/apps/sim/app/workspace/[workspaceId]/w/[workflowId]/hooks/use-workflow-execution.ts b/apps/sim/app/workspace/[workspaceId]/w/[workflowId]/hooks/use-workflow-execution.ts index 21f46be3c7..c26c313d6b 100644 --- a/apps/sim/app/workspace/[workspaceId]/w/[workflowId]/hooks/use-workflow-execution.ts +++ b/apps/sim/app/workspace/[workspaceId]/w/[workflowId]/hooks/use-workflow-execution.ts @@ -1124,9 +1124,7 @@ export function useWorkflowExecution() { {} as typeof workflowBlocks ) - const isExecutingFromChat = - overrideTriggerType === 'chat' || - (workflowInput && typeof workflowInput === 'object' && 'input' in workflowInput) + const isExecutingFromChat = overrideTriggerType === 'chat' logger.info('Executing workflow', { isDiffMode: currentWorkflow.isDiffMode,