fix(copilot): incorrectly sanitizing json state#2346
Merged
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub. |
Contributor
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
|
Contributor
There was a problem hiding this comment.
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
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
Fix copilot json state sanitization
Type of Change
Testing
Manual
Checklist