fix(chat): drop unparsable special-tag payloads instead of dumping raw JSON - #6142
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub. |
PR SummaryMedium Risk Overview Classification splits unparseable bodies via Streaming keeps Tests cover production typo shapes, inline tags, blank messages, and frame-by-frame streaming stability. Reviewed by Cursor Bugbot for commit d49122a. Bugbot is set up for automated code reviews on this repo. Configure here. |
Greptile SummaryThe parser now distinguishes malformed attempted payloads from prose and suppresses only the former.
Confidence Score: 5/5The PR appears safe to merge. No blocking failure remains.
|
| Filename | Overview |
|---|---|
| apps/sim/app/workspace/[workspaceId]/home/components/message-content/components/special-tags/special-tags.tsx | Refines malformed-body classification and streaming suppression while fixing the previously reported prose-deletion path. |
| apps/sim/app/workspace/[workspaceId]/home/components/message-content/components/special-tags/special-tags.test.ts | Adds focused regression coverage for malformed payload suppression and preservation of quoted or brace-wrapped prose. |
Reviews (3): Last reviewed commit: "improvement(chat): require key-value col..." | Re-trigger Greptile
… for mispaired quotes
|
@cursor review |
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 9775580. Configure here.
…n unparsable tag body
|
@cursor review |
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 d49122a. Configure here.
Summary
]}, trailing comma) were rendering the entire raw JSON as prose — the parser only dropped payloads that parsed but failed their shape guardnever-jsonclass in two: a body that opens like a JSON payload ({",[{,[") but won't parse is nownot-parsableand gets dropped likewrong-shape; prose-ish bodies ({the Q4 report}, unquoted-key slips, bare scalars) arenot-a-payloadand still render verbatimwasAttemptedPayloadopener predicate draws that line; the discarded-tag guard covers the new class so a message that is only a broken payload renders blank instead of resurrecting the JSON via the raw-content fallbackType of Change
Testing
81 unit tests passing across both special-tags test files. Verified manually in Chat against the full fixture matrix: broken payloads drop, prose survives, valid cards render and stay interactive, nested-tag rescue holds, blank-message fallback guard holds. Lint and all boundary/audit checks pass.
Checklist