-
Notifications
You must be signed in to change notification settings - Fork 3.2k
fix(copilot): incorrectly sanitizing json state #2346
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 OverviewGreptile SummaryThis PR simplifies the JSON sanitization logic for the copilot feature by:
Note: The Confidence Score: 4/5
Important Files ChangedFile Analysis
Sequence DiagramsequenceDiagram
participant Caller
participant sanitizeSubBlocks
participant sortKeysRecursively
Caller->>sanitizeSubBlocks: subBlocks
loop Each subBlock entry
alt null/undefined value
sanitizeSubBlocks-->>sanitizeSubBlocks: skip
else key === 'responseFormat'
alt string value
sanitizeSubBlocks->>sanitizeSubBlocks: JSON.parse()
end
alt parsed is object
sanitizeSubBlocks->>sortKeysRecursively: obj
sortKeysRecursively-->>sanitizeSubBlocks: sorted obj
sanitizeSubBlocks->>sanitizeSubBlocks: sanitized[key] = sorted
else invalid JSON
sanitizeSubBlocks->>sanitizeSubBlocks: sanitized[key] = original value
end
else condition-input type
sanitizeSubBlocks->>sanitizeSubBlocks: sanitizeConditions()
else tools array
sanitizeSubBlocks->>sanitizeSubBlocks: sanitizeTools()
else default
sanitizeSubBlocks->>sanitizeSubBlocks: sanitized[key] = value
end
end
sanitizeSubBlocks-->>Caller: sanitized record
|
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/lib/workflows/sanitization/json-sanitizer.ts, line 71-101 (link)style:
isSensitiveSubBlockfunction is no longer called anywhere after removing sensitive field filtering. Can be removed along with theTRIGGER_PERSISTED_SUBBLOCK_IDSimport on line 5.
1 file reviewed, 1 comment
Summary
Fix copilot json state sanitization
Type of Change
Testing
Manual
Checklist