Skip to content

fix(chat): preserve literal code around source chips - #7456

Open
waleedlatif1 wants to merge 2 commits into
stagingfrom
codex/fix-release-review-findings
Open

fix(chat): preserve literal code around source chips#7456
waleedlatif1 wants to merge 2 commits into
stagingfrom
codex/fix-release-review-findings

Conversation

@waleedlatif1

@waleedlatif1 waleedlatif1 commented Sep 3, 2026

Copy link
Copy Markdown
Collaborator

Summary

  • Preserve multi-backtick code spans and fenced examples containing source or workspace-resource chips.
  • Keep unmatched delimiter runs as prose, pair only within paragraphs, and recognize longer closing fences.
  • Bound malformed JSON scanning by rejecting escapes outside JSON strings.
  • Rebased onto fix(chat): preserve queued edits and render quoted source chips #7452; retains its citation and queued-edit fixes without duplicating them.

Type of Change

  • Bug fix

Testing

  • 245 message-content tests passed, including delimiter, JSON-marker, and malformed-input scaling regressions.
  • Reproduced the three-backtick rendering bug and malformed escaped-JSON slowdown on current staging.
  • Workspace type-checks, lint, all 45 repository audits, generated-artifact checks, and cleanup/simplification review passed.

Checklist

  • Code follows project style guidelines
  • Self-reviewed my changes
  • Tests added/updated and passing
  • No new warnings introduced
  • I confirm that I have read and agree to the terms outlined in the Contributor License Agreement (CLA)

@vercel

vercel Bot commented Sep 3, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

1 Skipped Deployment
Project Deployment Actions Updated
docs Skipped Skipped Sep 3, 2026 9:47pm UTC

Request Review

@waleedlatif1

Copy link
Copy Markdown
Collaborator Author

@greptile

@waleedlatif1

Copy link
Copy Markdown
Collaborator Author

@cubic-dev-ai review this PR

@cubic-dev-ai

cubic-dev-ai Bot commented Sep 3, 2026

Copy link
Copy Markdown
Contributor

@cubic-dev-ai review this PR

@waleedlatif1 I have started the AI code review. It will take a few minutes to complete.

@greptile-apps

greptile-apps Bot commented Sep 3, 2026

Copy link
Copy Markdown
Contributor

Greptile Summary

The PR fixes chat-content sanitization so literal code around source and workspace-resource chips is preserved while valid citations continue rendering.

  • Treats consecutive backticks as delimiter runs and preserves fenced or matched multi-backtick code.
  • Scopes delimiter pairing to prose paragraphs without splitting complete multiline chip JSON.
  • Tightens JSON escape recognition to bound malformed-input scanning.
  • Adds delimiter, paragraph-boundary, malformed-input scaling, and JSON-marker regressions.

Confidence Score: 5/5

The PR appears safe to merge.

No blocking failure remains; the current implementation and regressions address the previously reported delimiter-pairing and quoted-tag issues.

Important Files Changed

Filename Overview
apps/sim/app/workspace/[workspaceId]/home/components/message-content/components/chat-content/chat-sanitize.ts Implements paragraph-scoped delimiter pairing, fenced-code preservation, and bounded JSON-chip recognition; the previously reported failures are addressed.
apps/sim/app/workspace/[workspaceId]/home/components/message-content/components/chat-content/chat-content.test.ts Adds focused regressions for all three prior review threads plus malformed-input scaling cases.
apps/sim/app/workspace/[workspaceId]/home/components/message-content/components/scaling-test-helpers.ts Generalizes the scaling helper with injectable input builders while retaining its existing default behavior.

Reviews (3): Last reviewed commit: "fix(chat): scope delimiter pairing to pa..." | Re-trigger Greptile

@cubic-dev-ai cubic-dev-ai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

All reported issues were addressed across 3 files

Reply with feedback, questions, or to request a fix.

Fix all with cubic | Re-trigger cubic

@waleedlatif1
waleedlatif1 force-pushed the codex/fix-release-review-findings branch from c327392 to 2d5b329 Compare September 3, 2026 21:36
@waleedlatif1 waleedlatif1 changed the title fix(chat): preserve backticks inside citation JSON fix(chat): preserve literal code around source chips Sep 3, 2026
@waleedlatif1

Copy link
Copy Markdown
Collaborator Author

@greptile

@waleedlatif1

Copy link
Copy Markdown
Collaborator Author

@cubic-dev-ai review this PR

@cubic-dev-ai

cubic-dev-ai Bot commented Sep 3, 2026

Copy link
Copy Markdown
Contributor

@cubic-dev-ai review this PR

@waleedlatif1 I have started the AI code review. It will take a few minutes to complete.

@cubic-dev-ai cubic-dev-ai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No issues found across 3 files

Confidence score: 5/5

  • Automated review surfaced no issues in the provided summaries.
  • No files require special attention.

Re-trigger cubic

@waleedlatif1

Copy link
Copy Markdown
Collaborator Author

@greptile

@waleedlatif1

Copy link
Copy Markdown
Collaborator Author

@cubic-dev-ai review this PR

@cubic-dev-ai

cubic-dev-ai Bot commented Sep 3, 2026

Copy link
Copy Markdown
Contributor

@cubic-dev-ai review this PR

@waleedlatif1 I have started the AI code review. It will take a few minutes to complete.

@waleedlatif1

Copy link
Copy Markdown
Collaborator Author

@cubic-dev-ai review this PR

@cubic-dev-ai

cubic-dev-ai Bot commented Sep 3, 2026

Copy link
Copy Markdown
Contributor

@cubic-dev-ai review this PR

@waleedlatif1 I have started the AI code review. It will take a few minutes to complete.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant