Repository navigation
fix(workflows): stop flagging whole-field references in JSON fields and correct the quoting advice - #8837
Merged
Conversation
…nd correct the quoting advice
|
The latest updates on your projects. Learn more about Vercel for GitHub. |
Contributor
There was a problem hiding this comment.
1 issue found across 2 files
Confidence score: 3/5
- In
apps/sim/lib/workflows/editing/lint.ts, the blanket exemption also coverstable_v2.dataandrows, whose handlers parse them as JSON, so malformed<agent.content>can still fail at runtime without a warning. Restrict the exemption to raw paths.
Prompt for AI agents (unresolved issues)
Check if these issues are valid — if so, understand the root cause of each and fix them. When an issue isn't valid or won't be fixed in this PR, reply in its thread with the reason and then resolve the thread. If appropriate, use sub-agents to investigate and fix each issue separately.
<file name="apps/sim/lib/workflows/editing/lint.ts">
<violation number="1" location="apps/sim/lib/workflows/editing/lint.ts:775">
P2: `table_v2.data` and `rows` also reach this helper, but their handlers parse them as JSON, so `<agent.content>` can still fail at runtime while this blanket exemption hides the warning. Restrict the exemption to raw pass-through fields such as `api.body` and `response.data`.</violation>
</file>
Reply with feedback, questions, or to request a fix.
Turn on auto-fix | Re-trigger cubic
Contributor
|
Collaborator
Author
Collaborator
Author
|
@cubic-dev-ai review this PR |
Contributor
@waleedlatif1 I have started the AI code review. It will take a few minutes to complete. |
This branch was previously deployed
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
<agent.content>). The block receives that text as-is: Response returns text it can't parse unchanged, API sends it as a raw body. Quoting it would only turn JSON text into a JSON string.{"note": <agent.content>},[<agent.content>]) still flags, as do the Table row cases.",\or line break (ids and the like). For free text it now says to build the JSON in a Function block and set the field to that block's result reference.Type of Change
Testing
json-literal-refs.test.ts: whole-field and references-only fields don't flag, references inside JSON still flag, advice text. The behavior tests fail on the previous code and pass now.<agent.content>flagged before, clean after; API{"text": <agent.content>}and Table v2 Insert Row{"name": <agent.content>}flag both before and after.bun run lint,bun run type-check,bun run check:audits, vitest onlib/workflows/editing,lib/workflows/application,executor/variables.Checklist