Repository navigation
fix(web): keep citation markers users type in their own messages - #39657
Open
LetterXbox wants to merge 1 commit into
Open
LetterXbox wants to merge 1 commit into
LetterXbox wants to merge 1 commit into
Conversation
User prompts render through the same Markdown pipeline as assistant output, so a web citation marker a user typed vanished from the conversation and from thread find while the raw text still went to the agent. remarkCodexDirectives takes a keepWebCitations option, and the new CHAT_USER_MARKDOWN_REMARK_PLUGINS list reconfigures it for user-authored text: sent messages, review comment text, and the user find processor. Assistant output still hides the markers. The option restores the marked fields around the existing walk rather than threading a flag through it, so the walker stays as the stacked citation fixes leave it. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Part of #30979. Stacked on #31053, so it targets
fix/issue-30979. It addresses the remaining review finding on #31053: citation stripping should apply only to assistant output, and markers in user messages should be preserved.Problem
#31053 hides web citation markers (
U+E200 cite U+E202 turn0search0 U+E201) with a remark transform that runs on everyChatMarkdownrender. User prompts render through the same pipeline. So a marker the user typed disappears from their sent message and from thread find, even though the raw text went to the agent unchanged.Fix
remarkCodexDirectivestakes akeepWebCitationsoption. A newCHAT_USER_MARKDOWN_REMARK_PLUGINSlist reconfigures the plugin for user-authored text:UserMessageBody; side chat uses the same row)Assistant output, agent questions, plans and reasoning still hide markers.
The option restores the marked text and URL fields around the existing walk instead of threading a flag through it. That leaves the walker exactly as #33049 rewrites it. Once #33049 lands, the gate can move into the walker.
No changes were needed for:
Verification
codexMarkdownDirectives.test.tsand one inthreadFindText.test.ts. Both fail on 7c74436: the marker is stripped from a user message ("Explain \uE200cite\uE202turn0search0\uE201 please"→"Explain please") and from text, labels and link destinations. Both pass with the fix. ThethreadFindText,codexMarkdownDirectivesandmarkdownPipelinesuites pass 68/68.vp run check:changed origin/fix/issue-30979: format, lint, knip, typecheck (35 packages), tests and the React compiler check all pass.git merge-treeis clean against fix(shared): keep words separated when hiding citations #33049 (f7201b0) and fix(shared): hide a web citation marker that is still streaming #34864's own commit (cc8ae86).mainmerge that head carries, where fix(web): preserve single tildes in sent user messages #35859 already definesCHAT_USER_MARKDOWN_REMARK_PLUGINS. The resolution is one list holding both entries (remarkGfmwithsingleTilde: false, plusremarkCodexDirectiveswithkeepWebCitations: true). With that, 96/96 tests pass.Please explain this literal marker: \uE200cite\uE202turn0search0\uE201 in my message.from the composer. On 7c74436 the sent bubble readsPlease explain this literal marker: in my message.With this branch it shows the marker as typed (the private-use characters render as font fallback glyphs).Not covered:
Implemented with Claude Code (Opus 5.5) and reviewed with Codex (GPT-6.2 Astra).
🤖 Generated with Claude Code