-
Notifications
You must be signed in to change notification settings - Fork 3.1k
fix(variables): fix variable resolution error and start block outputs #1847
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
Merged
+112
−62
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
|
The latest updates on your projects. Learn more about Vercel for GitHub. |
Contributor
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.
Greptile Overview
Greptile Summary
This PR improves error handling in the block executor and fixes variable resolution behavior when blocks haven't executed yet.
Key changes:
- Error handling refactoring: Extracted duplicate error handling logic into a dedicated
handleBlockErrormethod that properly catches and surfaces input resolution errors, ensuring errors during variable resolution are now properly logged and handled - Variable resolution fix: Changed
BlockResolverto returnundefinedinstead of throwing an error when a block output isn't found, allowing graceful handling of missing upstream block outputs - Start block output filtering: Modified start block output generation to exclude empty
conversationIdfields (setting toundefinedinstead of empty string) to prevent unnecessary fields in block outputs
Confidence Score: 4/5
- This PR is safe to merge with minor testing considerations
- The refactoring is well-structured and improves error handling. The behavior change for
conversationId(empty string toundefined) may require test updates. The variable resolution change is sensible but should be verified with integration tests to ensure no regressions in workflows that depend on this behavior. - apps/sim/executor/utils/start-block.ts - verify test compatibility with conversationId behavior change
Important Files Changed
File Analysis
| Filename | Score | Overview |
|---|---|---|
| apps/sim/executor/execution/block-executor.ts | 5/5 | Refactored error handling to properly catch and surface input resolution errors by extracting error handling logic into a dedicated handleBlockError method |
| apps/sim/executor/utils/start-block.ts | 4/5 | Changed conversationId handling to be undefined instead of empty string when not set, may need test updates |
| apps/sim/executor/variables/resolvers/block.ts | 5/5 | Changed block output resolution to return undefined instead of throwing error when block state is not found |
Sequence Diagram
sequenceDiagram
participant Executor as BlockExecutor
participant Resolver as VariableResolver
participant BlockRes as BlockResolver
participant State as ExecutionState
Note over Executor: Block Execution Start
Executor->>Resolver: resolveInputs(ctx, nodeId, params, block)
Resolver->>BlockRes: resolve(reference, context)
BlockRes->>State: getBlockOutput(blockId, currentNodeId)
alt Block output exists
State-->>BlockRes: return output
BlockRes-->>Resolver: return resolved value
Resolver-->>Executor: return resolvedInputs
Note over Executor: Continue execution
else Block output not found (NEW)
State-->>BlockRes: return undefined
BlockRes-->>Resolver: return undefined (no error thrown)
Resolver-->>Executor: return resolvedInputs
Note over Executor: Handle gracefully
else Resolution error (NEW)
BlockRes-->>Resolver: throw error
Resolver-->>Executor: throw error
Executor->>Executor: handleBlockError(phase: 'input_resolution')
Note over Executor: Log error & set error output
end
alt Has error port
Executor-->>Executor: Return error output
else No error port
Executor-->>Executor: Throw BlockExecutionError
end
3 files reviewed, 1 comment
waleedlatif1
pushed a commit
that referenced
this pull request
Nov 9, 2025
…#1847) * Fix var resolution if block is not upstream * Filter convo id from start block outputs if not set * Lint * Start block outputs
waleedlatif1
pushed a commit
that referenced
this pull request
Nov 12, 2025
…#1847) * Fix var resolution if block is not upstream * Filter convo id from start block outputs if not set * Lint * Start block outputs
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Summary
Fix variable resolution error surfacing and start block outputs
Type of Change
Testing
Manual
Checklist