Render rich content components in the transcript - #915
Conversation
|
Warning This pull request is not mergeable via GitHub because a downstack PR is open. Once all requirements are satisfied, merge this PR as a stack on Graphite.
This stack of pull requests is managed by Graphite. Learn more about stacking. |
| if (/^https:\/\//i.test(raw)) return raw; | ||
| if (/^data:image\//i.test(raw)) return raw; | ||
| return undefined; | ||
| } |
There was a problem hiding this comment.
Image URLs truncated to 500 chars
Medium Severity
parseImageUrl runs URLs through parseText, which slices to MAX_TEXT_LENGTH (500). Signed CDN/S3 URLs and real data:image payloads routinely exceed that, so valid images are returned truncated and fail to load while the card still renders.
Additional Locations (1)
Reviewed by Cursor Bugbot for commit 4d33abe. Configure here.
0659a44 to
a9b4b67
Compare
4d33abe to
b380126
Compare
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes using default effort and found 1 potential issue.
There are 2 total unresolved issues (including 1 from previous review).
❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, have a team admin enable autofix in the Cursor dashboard.
Reviewed by Cursor Bugbot for commit b380126. Configure here.
| > | ||
| {button.label} | ||
| </Button> | ||
| ))} |
There was a problem hiding this comment.
Card buttons skip scroll pin
Medium Severity
Card button clicks call sendUserMessage without setting scrollPinned to true. The text input path does pin scroll before send, so after scrolling up to tap a card the follow-up user message and agent reply can stay off-screen.
Reviewed by Cursor Bugbot for commit b380126. Configure here.



Summary
RFC
Renders the components an agent sends inline in the transcript, starting with an item card: an identifier and title, plus optional subtitle, image, description, price, and up to three buttons. Buttons send a follow-up message as the user.
Builds on the
onRichContentcallback from the SDK PR. The widget appends each component to the transcript as it arrives, and renders anything it doesn't recognize as a short notice rather than breaking the turn.Nothing is visible until the backend can send
rich_content, which isn't merged yet. Open to edit the design and props. Just wanted to get this out there as a first pass.Preview of the item card with example data

Note
Medium Risk
New user-facing transcript rendering and agent-driven UI (images, buttons sending messages) with validation mitigations; depends on SDK/backend rich_content delivery not yet merged.
Overview
Adds inline rich content in the convai widget transcript when the agent sends
rich_contentevents (via SDKonRichContent). The first supported component isitem_card: title, optional subtitle, image, description, price, and up to three buttons that callsendUserMessagewith preset text.Transcript pipeline: a new
rich_contententry type is appended on arrival with deduplication byrichContentId.buildDisplayTranscriptpasses these through in order (cards stay where they arrived; empty agent placeholders can be dropped when a card follows).TranscriptMessageroutes rich entries toRichContentRenderer.Safety:
parseItemCardPropsvalidates and normalizes agent props (text limits, https /data:imageURLs only, button caps). Unknown or invalid components show the configurablerich_content_unavailablenotice instead of breaking the turn.Tests & mocks: validation unit tests, display-transcript scenarios for ordering with tools/typing, and a
rich_contentmock agent for manual/dev testing.Reviewed by Cursor Bugbot for commit b380126. Bugbot is set up for automated code reviews on this repo. Configure here.