Repository navigation
fix(chat): render Codex source citations - #9605
juliusmarminge wants to merge 2 commits into
Conversation
Thread transfer impact✅ Thread transfer remains within every enforced ceiling.
Baseline: Scenario and decoded snapshot size10 historical turns, 5 command tools per turn, 878.9 KiB retained MCP result per historical turn, and a 1.05 MiB retained result in the measured turn.
Updated in place by a trusted workflow. PR artifacts are strictly validated and never executed. |
ApprovabilityVerdict: Not approved Macroscope's review found this PR not approvable — This PR introduces a shared Markdown citation parser, interactive source chips, streaming handling, and clipboard/list-position changes across web and mobile chat. These changes alter multiple existing production paths and add substantial new runtime logic rather than remaining a small isolated adjustment. Notes:
You can add or adjust custom eligibility rules. Learn more. |
Codex source citations currently appear as raw marker text in chat. Render them as numbered chips on web and desktop, with a popover showing the original source IDs and optional line ranges.
Mobile responses and copy/paste use readable references with the same numbering. Code and link examples stay literal, incomplete streaming markers stay hidden until resolved, and stored message text is unchanged. Shared list recovery keeps citation positions correct when copying over-indented content.
Source IDs do not contain destination URLs. The popover explains when the source URL is unavailable; this change does not guess links or add server requests.
Verification
Before and after
Before, from base
f559fe0ba:After, from head
5014ada6a:Recording, including grouped source details and line ranges:
Implemented with Codex.
Note
Medium Risk
Touches shared Markdown parsing, streaming display, and clipboard serialization across web and mobile; regressions could affect copy behavior or citation rendering without changing stored data.
Overview
Codex’s private-use citation markers in assistant Markdown are now parsed and shown as numbered source references instead of raw marker text. A new shared
@t3tools/client-runtime/codex-citationsmodule owns parsing, first-appearance numbering,remarkCodexCitations, andrenderCodexCitationsAsMarkdown(with streaming tail hiding for incomplete markers).Web/desktop wires the remark plugin into
ChatMarkdown, sanitizes citation payload onspan, and rendersCodexCitationChippopovers (source IDs and line locators; no invented URLs). Mobile converts citations before native Markdown and artifact splitting, and passesisStreamingthrough.Copy/paste applies the same readable
[Source N: …]text for whole-message copy (MessagesTimeline.logic, mobile copy button) and improves clipboard handling so partial selections of citation chips anddata-markdown-copy-textpaste correctly. List-indentation recovery moves into client-runtime with source-position remapping so over-indented bullets and citations keep correct offsets. Stored message text is unchanged; code, links, and directives still leave markers literal.Reviewed by Cursor Bugbot for commit 5014ada. Bugbot is set up for automated code reviews on this repo. Configure here.
Note
Add Codex source citation rendering across web and mobile chat
AssistantMarkdownContentwith anisStreamingpropmarkdown-list-indentationfrom the web path now get a re-export of the client-runtime implementation, and the newremarkCodexCitationsplugin changes remark plugin ordering inChatMarkdownMacroscope summarized 5014ada.