-
Notifications
You must be signed in to change notification settings - Fork 3.1k
fix(condition): async execution isolated vm error #2446
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub. |
Greptile SummaryFixed async execution failure in condition blocks when running in Trigger.dev's isolated VM worker environment by replacing Key Changes:
Technical Context: Confidence Score: 4/5
Important Files Changed
Sequence DiagramsequenceDiagram
participant CH as ConditionBlockHandler
participant EV as evaluateConditionExpression
participant ET as executeTool
participant API as /api/function/execute
participant VM as Execution Environment
CH->>EV: evaluateConditionExpression(ctx, expression, block)
EV->>EV: Resolve variable/block/env references
EV->>EV: Build code with context injected via JSON.stringify
EV->>ET: executeTool with function_execute toolId
ET->>API: POST request with code and params
API->>VM: Execute code in safe environment
VM-->>API: Return execution result
API-->>ET: Return success and output
ET-->>EV: Return tool response
EV->>EV: Extract Boolean from result.output.result
EV-->>CH: Return Boolean evaluation result
CH->>CH: Select execution path based on conditions
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Additional Comments (1)
-
apps/sim/executor/handlers/condition/condition-handler.ts, line 23 (link)logic:
evalContextis constructed but never used, conditions relying oncontextvariables will failThe old
executeInIsolatedVMimplementation passedcontextVariables: { context: evalContext }to make source block output available ascontextin evaluated expressions. The new implementation doesn't pass this anywhere, breaking conditions likecontext.value > 5.
1 file reviewed, 3 comments
Summary
Async execution in condition blocks tries to execute directly in trigger dev context which fails in isolated vm worker run.
Type of Change
Testing
Tested manually
Checklist