improvement(executor): reserved keyword errors#4482
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub. |
PR SummaryMedium Risk Overview Start block output building now rejects reserved execution-control field names (e.g. Function execution now accepts an optional Reviewed by Cursor Bugbot for commit a1a09bf. Configure here. |
Greptile SummaryThis PR fixes two distinct classes of silent failure in the executor: Start blocks that accept reserved field names (e.g.
Confidence Score: 5/5Safe to merge; the changes add fail-fast validation and improve error UX with no mutations to execution logic. Both changes are purely additive: the start-block guards throw before any output is produced, and the function-error-display path only rewrites the message shown to the user, never the execution result. All new code paths have targeted tests, chat paths are correctly exempted from the inputFormat check, and the message cleanup is gated behind No files require special attention. Important Files Changed
Flowchart%%{init: {'theme': 'neutral'}}%%
flowchart TD
A[buildStartBlockOutput] --> B{pathConsumesInputFormat?}
B -- yes --> C[assertNoReservedInputFormatFields\nthrows if field names collide]
B -- no\nchat paths --> D[skip inputFormat check]
C --> E[deriveInputFromFormat]
D --> E
E --> F{resolution.path switch}
F --> G[UNIFIED / SPLIT_API / SPLIT_INPUT\n/ SPLIT_MANUAL / EXTERNAL_TRIGGER\n/ LEGACY_STARTER]
G --> H[build output NormalizedBlockOutput]
H --> I[assertNoReservedStartOutputFields\nthrows if output keys collide]
I --> J[return output]
subgraph Function Error Display
K[FunctionBlockHandler.execute] --> L[readCodeContent block.config.params.code\n= sourceCode]
L --> M[executeTool function_execute\ncode + sourceCode]
M --> N[route.ts POST handler]
N --> O{error?}
O -- yes --> P[getErrorDisplayCode\nprefer sourceCode over resolvedCode]
P --> Q[getErrorDisplayMessage\nstrip globalThis refs from message]
Q --> R[getLineContent\nlook up line in sourceCode]
R --> S[return user-facing error\nwith original source context]
end
Reviews (2): Last reviewed commit: "address comments and make error messages..." | Re-trigger Greptile |
|
bugbot run |
|
@greptile |
There was a problem hiding this comment.
✅ Bugbot reviewed your changes and found no new issues!
Comment @cursor review or bugbot run to trigger another review on this PR
Reviewed by Cursor Bugbot for commit a1a09bf. Configure here.
* improvment(executor): reserved keyword errors * address comments and make error messages for func execute make sense block ref accs
Summary
Reserved keyword errors must be surfaced. Fails execution silently otherwise.
Type of Change
Testing
Tested manually
Checklist