fix(codegen): function prologue resolution edge cases#3005
Merged
icecrasher321 merged 7 commits intostagingfrom Jan 26, 2026
Merged
fix(codegen): function prologue resolution edge cases#3005icecrasher321 merged 7 commits intostagingfrom
icecrasher321 merged 7 commits intostagingfrom
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub. |
Contributor
Greptile OverviewGreptile SummaryThis PR standardizes variable resolution and code generation across JavaScript and Python function execution contexts. The main change fixes boolean resolution to be more strict (only the string Key improvements:
Confidence Score: 5/5
Important Files Changed
Sequence DiagramsequenceDiagram
participant User
participant FunctionExecute as Function Execute API
participant VariableManager
participant VariableResolver
participant BlockResolver
participant IsolatedVM as Isolated VM Worker
User->>FunctionExecute: Execute function with variables
FunctionExecute->>VariableManager: resolveForExecution(value, type)
VariableManager->>VariableManager: convertToNativeType(value, 'boolean')
Note over VariableManager: Now only 'true' string → true<br/>('1' → false, changed behavior)
VariableManager-->>FunctionExecute: Resolved boolean value
FunctionExecute->>FunctionExecute: Build prologue for JS/Python
Note over FunctionExecute: Handle null: const x = null / x = None<br/>Handle boolean: const x = true / x = True<br/>Handle number: const x = 42 / x = 42
FunctionExecute->>IsolatedVM: Execute code with contextVariables
IsolatedVM->>IsolatedVM: Set context variables in jail
Note over IsolatedVM: Explicit null handling:<br/>if (value === null) jail.set(key, null)
alt Variable reference in template
User->>VariableResolver: resolveTemplate(template, block)
VariableResolver->>VariableResolver: Extract language from block config
Note over VariableResolver: language = block.config.params.language
VariableResolver->>BlockResolver: formatValueForBlock(value, blockType, isInTemplateLiteral, language)
BlockResolver->>BlockResolver: formatValueForCodeContext(value, isInTemplateLiteral, language)
Note over BlockResolver: Python: True/False/None<br/>JS: true/false/undefined/null
BlockResolver-->>VariableResolver: Formatted value
VariableResolver-->>User: Resolved template
end
|
Collaborator
Author
|
@cursor review |
Collaborator
Author
|
@cursor review |
Collaborator
Author
|
@cursor review |
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
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
Codegen standardized for Python vs JS in terms of variable resolution. Main change fixes boolean resolution.
Type of Change
Testing
Tested manually
Checklist