fix(condition): async execution isolated vm error#2446
fix(condition): async execution isolated vm error#2446icecrasher321 merged 2 commits intostagingfrom
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.
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
|
@greptile |
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