Skip to content

fix(executor): duplicate error, cmd+enter - #1920

Merged
Sg312 merged 3 commits into
stagingfrom
fix/executor-again
Nov 12, 2025
Merged

fix(executor): duplicate error, cmd+enter#1920
Sg312 merged 3 commits into
stagingfrom
fix/executor-again

Conversation

@Sg312

Copy link
Copy Markdown
Collaborator

Summary

Fixes duplicate error and cmd+enter to run workflow

Type of Change

  • Bug fix

Testing

Manual

Checklist

  • Code follows project style guidelines
  • Self-reviewed my changes
  • Tests added/updated and passing
  • No new warnings introduced
  • I confirm that I have read and agree to the terms outlined in the Contributor License Agreement (CLA)

@vercel

vercelBot commented Nov 12, 2025

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

1 Skipped Deployment
ProjectDeploymentPreviewCommentsUpdated (UTC)
docsSkippedSkippedNov 12, 2025 9:40am

@greptile-apps

Copy link
Copy Markdown
Contributor

Greptile Overview

Greptile Summary

Fixed duplicate error logging and Cmd+Enter keyboard shortcut behavior for workflow execution.

  • Error logging: Prevented duplicate error messages by ensuring BlockExecutor logs complete error details once, while higher-level handlers (route.ts) only log error messages. Frontend now distinguishes between pre-execution errors (validation/serialization) and block execution errors.
  • Cmd+Enter fix: Simplified keyboard shortcut handler to exactly mirror the Run button behavior by removing unnecessary disabled state check that was preventing execution.
  • Error metadata: Preserved block error metadata (blockId, blockName, blockType) by attaching executionResult to original error objects instead of creating new ones.
  • Unhandled promises: Added empty catch handler in trackExecution to prevent unhandled rejection warnings while errors are properly handled by Promise.all/Promise.race.

Confidence Score: 5/5

  • This PR is safe to merge with no risk - it only improves error handling and fixes a keyboard shortcut bug
  • The changes are well-reasoned bug fixes that improve error handling by reducing duplicate logging, preserving error metadata, and fixing the Cmd+Enter shortcut. All changes follow defensive programming patterns (checking for object types, using fallbacks). No new functionality or breaking changes introduced.
  • No files require special attention

Important Files Changed

File Analysis

FilenameScoreOverview
apps/sim/app/api/workflows/[id]/execute/route.ts5/5Reduced duplicate error logging by only logging error messages instead of full error objects, since BlockExecutor already logs complete error details
apps/sim/app/workspace/[workspaceId]/w/[workflowId]/components/panel-new/panel-new.tsx5/5Simplified Cmd+Enter handler to match button behavior exactly, removing unnecessary disabled state check and error handling
apps/sim/app/workspace/[workspaceId]/w/[workflowId]/hooks/use-workflow-execution.ts5/5Added check to prevent duplicate console entries for block errors by only logging pre-execution errors (validation, serialization) when no blocks have executed
apps/sim/executor/execution/engine.ts5/5Preserved original error metadata by attaching executionResult to existing error instead of creating new one, plus added empty catch handler to prevent unhandled rejection warnings

Sequence Diagram

sequenceDiagram
participant User
participant Panel as Panel UI
participant Hook as useWorkflowExecution
participant API as Execute Route
participant Engine as ExecutionEngine
participant BlockExec as BlockExecutor
User->>Panel: Press Cmd+Enter or Click Run
Panel->>Hook: runWorkflow()
Hook->>API: POST /api/workflows/[id]/execute
alt Pre-execution Error (validation/serialization)
API-->>Hook: Error (no blocks executed)
Hook->>Hook: Check existingLogs.length === 0
Hook->>Hook: addConsole (validation error)
else Normal Execution
API->>Engine: execute()
Engine->>BlockExec: executeBlock()
alt Block Error
BlockExec->>BlockExec: logger.error (full details)
BlockExec-->>Engine: throw error with metadata
Engine->>Engine: Attach executionResult to error
Engine-->>API: throw error
API->>API: Log only error.message
API-->>Hook: onBlockError callback
Hook->>Hook: addConsole (block error)
else Block Success
BlockExec-->>Engine: success
Engine-->>API: success
API-->>Hook: onBlockComplete callback
end
end
Loading

@greptile-appsgreptile-appsBot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

4 files reviewed, no comments

Edit Code Review Agent Settings | Greptile

@Sg312
Sg312 merged commit 56835b9 into stagingNov 12, 2025
9 checks passed
waleedlatif1 pushed a commit that referenced this pull request Nov 12, 2025
* Fix executor error
* Fix cmd+enter
* Lint
@waleedlatif1
waleedlatif1 deleted the fix/executor-again branch November 12, 2025 15:39
waleedlatif1 pushed a commit that referenced this pull request Nov 12, 2025
* Fix executor error
* Fix cmd+enter
* Lint
@waleedlatif1waleedlatif1 mentioned this pull request Nov 12, 2025
10 tasks
Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant

@Sg312