Skip to content

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

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

fix(chat): preserve literal code around source chips#7456
waleedlatif1 wants to merge 3 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 backtick/tilde-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

  • 252 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:56pm 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

This PR updates chat-content sanitization to preserve literal source and workspace-resource tags inside multi-backtick spans and fenced blocks while continuing to unwrap ordinary inline citations.

  • Groups consecutive backticks and pairs multi-backtick spans within paragraph boundaries.
  • Recognizes backtick and tilde fences, including unclosed streaming fences and longer valid closers.
  • Tightens chip JSON matching to bound malformed-input scans.
  • Adds delimiter, fence, quoted-tag, paragraph-boundary, and scaling regressions.

Confidence Score: 5/5

The PR appears safe to merge.

No blocking failure remains.

Important Files Changed

Filename Overview
apps/sim/app/workspace/[workspaceId]/home/components/message-content/components/chat-content/chat-sanitize.ts Reworks chip-aware inline-code and fenced-block handling and bounds malformed JSON matching; the previously reported cases are addressed without an eligible residual defect.
apps/sim/app/workspace/[workspaceId]/home/components/message-content/components/chat-content/chat-content.test.ts Adds comprehensive regressions for delimiter runs, paragraph boundaries, fences, quoted tag text, malformed input, and scaling.
apps/sim/app/workspace/[workspaceId]/home/components/message-content/components/scaling-test-helpers.ts Generalizes the scaling helper with a configurable input builder while preserving its existing default behavior.

Reviews (4): Last reviewed commit: "fix(chat): preserve tilde-fenced citatio..." | 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.

@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

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

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