Skip to content

fix(shared): hide a web citation marker that is still streaming - #34864

Open
LetterXbox wants to merge 1665 commits into
pingdotgg:fix/issue-30979from
LetterXbox:fix/citation-streaming-tail
Open

LetterXbox wants to merge 1665 commits into
pingdotgg:fix/issue-30979from
LetterXbox:fix/citation-streaming-tail

Conversation

@LetterXbox

@LetterXbox LetterXbox commented Nov 12, 2026 •

Copy link
Copy Markdown

Part of #30979. Stacked on #31053, so it targets fix/issue-30979. It is a focused fix for the same defect, within the markers #31053 already hides.

Problem

#31053 hides a web citation marker only after its closing U+E201 arrives. Codex streams item/agentMessage/delta in token-sized pieces, and the Codex adapter flushes them every 50 ms, so the displayed text can end partway through a marker. Until the rest arrives, citeturn… (or just ci) shows at the end of the message. If the stream stops there, the fragment stays. The web streaming path renders through the same remarkCodexDirectives transform and has no tail trimming; mobile goes through renderCodexMarkdownForNativeDisplay, and copy through renderCodexDirectivesForCopy.

Fix

WEB_CITATION_MARKER also matches an unfinished marker at the end of a text: U+E200 followed by any prefix of cite, U+E202 and the ids. The unfinished form allows no whitespace and must run to the end of a text node, so a malformed marker in the middle of a sentence is left as it was. It applies to finished messages too, so a stream that stopped mid-marker stays clean; #22034 restored the fragment once streaming ended, but these markers have no source data to show. Closed markers match exactly as before. Only the pattern changes; the replacement logic that #33049 rewrites is untouched, and this branch merges cleanly with it.

Verification

  • Extended the existing tests: one web AST assertion and two rows in the copy/native table. All 5 resulting assertions fail on 7c74436 (Rates held. citeturn0sea, Rates held. ci) and pass with the fix. vp test run packages/shared/src/codexMarkdownDirectives.test.ts: 52/52.
  • Merged with fix(shared): keep words separated when hiding citations #33049 at f7201b0: 85/85 in the same file.
  • vp run check:changed: format, lint, knip, typecheck (35 packages) and tests pass.
  • Real data: 13 assistant messages with 25 web citation markers from a T3 0.1.9 install. Cutting each message at every character inside a marker and running it through remark-parse, remark-gfm and the directive transform, 616/616 prefixes leaked before and 0/616 after. Finished messages produce identical output before and after on web, native display and copy.

Takeover verification at 5e7e4ada85: merged current main without rebasing, preserving mobile reference definitions before native citation rendering. Blacksmith vp run check:changed passes format, lint, knip, 35 package typechecks, 62 tests and the mobile compiler checks. Two independent source reviews found no issues. A real Chrome client replay through the ACP adapter and orchestration streamed a citation in separate chunks, left a final unfinished citation hidden, and preserved a citation inside code. Native mobile runtime and a paid Codex turn were not exercised.

citation fragments stay hidden while streaming through the real client

Implemented with Claude Code (Opus 5.5).

🤖 Generated with Claude Code

@github-actions github-actions Bot added vouch:unvouched Author is not yet trusted in the VOUCHED list. size:XS 0-9 changed lines (additions + deletions). labels Nov 12, 2026
@macroscopeapp

macroscopeapp Bot commented Nov 12, 2026

Copy link
Copy Markdown
Contributor

Approvability

Verdict: Approved at cc8ae86

Macroscope's review found this PR approvable — This change hides unfinished web citation markers while text is streaming. It is a narrowly scoped presentation correction with no evident material impact on stored data or external systems.

You can add or adjust custom eligibility rules. Learn more.

saphid and others added 26 commits November 14, 2026 08:28
…own merge request (pingdotgg#29791)

Co-authored-by: maria-rcks <maria@kuuro.net>
Co-authored-by: Julius Marminge <julius0216@outlook.com>
…otgg#33461)

Co-authored-by: maria-rcks <maria@kuuro.net>
Co-authored-by: Julius Marminge <julius0216@outlook.com>
… to 3x later (pingdotgg#33550)

Co-authored-by: Julius Marminge <julius0216@outlook.com>
…composer (pingdotgg#33341)

Co-authored-by: Julius Marminge <julius0216@outlook.com>
…ingdotgg#33475)

Co-authored-by: Julius Marminge <julius0216@outlook.com>
…anded (pingdotgg#33513)

Co-authored-by: Julius Marminge <julius0216@outlook.com>
…otgg#29801)

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Co-authored-by: Julius Marminge <julius0216@outlook.com>
…ve description-only matches (pingdotgg#33692)

Co-authored-by: Julius Marminge <julius0216@outlook.com>
… not a same-named one on PATH (pingdotgg#33836)

Co-authored-by: Julius Marminge <julius0216@outlook.com>
Co-authored-by: Julius Marminge <julius0216@outlook.com>
…tgg#33586)

Co-authored-by: Julius Marminge <julius0216@outlook.com>
…nstead of failing (pingdotgg#36821)

Co-authored-by: Julius Marminge <julius0216@outlook.com>
…tree (pingdotgg#36800)

Co-authored-by: Alex Southwell <4596216+saphid@users.noreply.github.com>
…g#33794)

Co-authored-by: Julius Marminge <julius0216@outlook.com>
…ingdotgg#33725)

Co-authored-by: DrSeedon <DrSeedon@users.noreply.github.com>
Co-authored-by: Julius Marminge <julius0216@outlook.com>
Co-authored-by: Julius Marminge <julius0216@outlook.com>
…#33840)

Co-authored-by: Simone <185146821+Lucenx9@users.noreply.github.com>
Co-authored-by: Julius Marminge <julius0216@outlook.com>
)

Co-authored-by: brkgzlsy <berke.guzelsoy@fabrite.ch>
Co-authored-by: Julius Marminge <julius0216@outlook.com>
…it (pingdotgg#33248)

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Co-authored-by: Julius Marminge <julius0216@outlook.com>
Co-authored-by: Julius Marminge <julius0216@outlook.com>
…auncher shortcuts (pingdotgg#33726)

Co-authored-by: Julius Marminge <julius0216@outlook.com>
… fetch (pingdotgg#33845)

Co-authored-by: Julius Marminge <julius0216@outlook.com>
…ingdotgg#35479)

Co-authored-by: Simone <185146821+Lucenx9@users.noreply.github.com>
Co-authored-by: Julius Marminge <julius0216@outlook.com>
MarcoDotIO and others added 25 commits November 14, 2026 19:05
…other limits (pingdotgg#31748)

Co-authored-by: maria-rcks <maria@kuuro.net>
Co-authored-by: Julius Marminge <julius0216@outlook.com>
… every folder for each expansion (pingdotgg#31465)

Co-authored-by: maria-rcks <maria@kuuro.net>
Co-authored-by: Julius Marminge <julius0216@outlook.com>
…dotgg#31781)

Co-authored-by: Julius Marminge <julius0216@outlook.com>
…nd draft rows (pingdotgg#31195)

Co-authored-by: Julius Marminge <julius0216@outlook.com>
pingdotgg#31593)

Co-authored-by: Matyas Rathonyi <matyasrathonyi@imac-server2.tailacc4a3.ts.net>
Co-authored-by: Julius Marminge <julius0216@outlook.com>
)

Co-authored-by: Julius Marminge <julius0216@outlook.com>
…text (pingdotgg#31780)

Co-authored-by: Julius Marminge <julius0216@outlook.com>
…ot resolve (pingdotgg#31747)

Co-authored-by: Devin <158243242+devin-ai-integration[bot]@users.noreply.github.com>
Co-authored-by: Julius Marminge <julius0216@outlook.com>
…dotgg#31931)

Co-authored-by: Julius Marminge <julius0216@outlook.com>
pingdotgg#31816)

Co-authored-by: maria-rcks <maria@kuuro.net>
Co-authored-by: Julius Marminge <julius0216@outlook.com>
…ingdotgg#37032)

Co-authored-by: Taylor Dolezal <117500+onlydole@users.noreply.github.com>
…d snoozed threads (pingdotgg#31894)

Co-authored-by: Julius Marminge <julius0216@outlook.com>
…otgg#31885)

Co-authored-by: Julius Marminge <julius0216@outlook.com>
…e sequences (pingdotgg#31882)

Co-authored-by: Julius Marminge <julius0216@outlook.com>
…ntry" and "1 cell" (pingdotgg#31886)

Co-authored-by: Julius Marminge <julius0216@outlook.com>
…pingdotgg#31929)

Co-authored-by: Geezy <igor.licko@gloryck.com>
Co-authored-by: Julius Marminge <julius0216@outlook.com>
# Conflicts:
#	apps/mobile/src/features/threads/ThreadFeed.tsx
@github-actions github-actions Bot added size:XXL 1,000+ changed lines (additions + deletions). and removed size:XS 0-9 changed lines (additions + deletions). labels Nov 15, 2026
@github-actions

Copy link
Copy Markdown
Contributor

This PR changes the test suite by +2198 test cases (browser +266, unit +994, server +938).

New browser test files: apps/web/src/browser/recordingCompositor.browser.test.ts, apps/web/src/browser/serverPictureInPicture.browser.test.ts, apps/web/src/components/AppSidebarLayout.browser.test.tsx, apps/web/src/components/ChatView.handoffCompaction.browser.test.tsx, apps/web/src/components/GitActionsControl.composition.browser.test.tsx, apps/web/src/components/RightPanelSheet.browser.test.tsx, apps/web/src/components/RightPanelTabs.browser.test.tsx, apps/web/src/components/Sidebar.shiftGuard.browser.test.ts, apps/web/src/components/chat/CollapsedComposerPromptPreview.browser.test.tsx, apps/web/src/components/chat/ComposerImageThumbnail.browser.test.tsx, apps/web/src/components/chat/ComposerPendingUserInputPanel.browser.test.tsx, apps/web/src/components/chat/ComposerPrimaryActions.browser.test.tsx, apps/web/src/components/chat/DraftHeroHeadline.browser.test.tsx, apps/web/src/components/chat/HtmlRenderDialog.browser.test.tsx, apps/web/src/components/chat/MarkdownCodeBlock.browser.test.tsx, apps/web/src/components/chat/McpAppFrame.browser.test.tsx, apps/web/src/components/chat/ThreadActivityAnnouncer.browser.test.tsx, apps/web/src/components/chat/ThreadDetailsPanel.browser.test.tsx, apps/web/src/components/chat/ThreadRelationshipsControl.remote-parent.browser.test.tsx, apps/web/src/components/chat/useComposerAttachmentIntake.browser.test.tsx, apps/web/src/components/chat/useComposerSelection.browser.test.tsx, apps/web/src/components/chat/useComposerStash.browser.test.tsx, apps/web/src/components/chat/useDraftEnvironmentRouting.browser.test.tsx, apps/web/src/components/chat/useFocusComposerOnThreadOpen.browser.test.tsx, apps/web/src/components/cloud/CloudEnvironmentConnectList.browser.test.tsx, apps/web/src/components/diffs/DiffFileTree.browser.test.tsx, apps/web/src/components/diffs/StyledDiffCodeView.browser.test.tsx, apps/web/src/components/files/AttachmentFilePreview.office.browser.test.tsx, apps/web/src/components/files/ReadOnlySourcePreview.browser.test.tsx, apps/web/src/components/files/office/fonts.browser.test.ts, apps/web/src/components/files/office/sheet-resize.browser.test.ts, apps/web/src/components/files/office/slide-fonts.browser.test.ts, apps/web/src/components/files/office/word-document.browser.test.ts, apps/web/src/components/files/office/word-images.browser.test.ts, apps/web/src/components/preview/ThreadPreviewMiniPlayer.browser.test.tsx, apps/web/src/components/settings/AddUsageLimitSourceDialog.browser.test.tsx, apps/web/src/components/settings/IntegrationsSettings.browser.test.tsx, apps/web/src/components/settings/LinkedEnvironmentsSettings.browser.test.tsx, apps/web/src/components/settings/ProviderModelsSection.browser.test.tsx, apps/web/src/components/ui/dialog.browser.test.tsx, apps/web/src/components/ui/tooltip.browser.test.tsx, apps/web/src/components/usage/UsagePriceOverrides.browser.test.tsx, apps/web/src/hooks/useAttachmentUploadProgress.browser.test.tsx, apps/web/src/hooks/useShownThreadRouteTarget.browser.test.tsx, apps/web/src/terminal/ghostty/renderer.browser.test.ts, apps/web/src/themeCss.browser.test.ts.
Each browser test file costs CI seconds of module loading before its first test runs; a unit test costs milliseconds.

Keep tests that would fail for a real reason, and test logic below the UI where it can be. See Testing.

@github-actions github-actions Bot added the 📱 Native Change Changes the native fingerprint; merging blocks production OTAs until a new store build ships. label Nov 15, 2026
@maria-rcks

Copy link
Copy Markdown
Collaborator

Note

Written by gpt-6.1-sol on behalf of Maria

Merged current main without rebasing. The mobile conflict resolution preserves reference definitions before native citation rendering. The citation-tail fix is unchanged.

Blacksmith vp run check:changed passed format, lint, knip, 35 package typechecks, 62 tests and mobile compiler checks. Two independent source reviews found no issues. All 34 reported CI checks are green at 5e7e4ada853a2ea417637b5ff31515f59cdf8f8c; GitHub reports no conflicts.

Chrome replay through the real ACP adapter, orchestration and web client confirmed partial citations remain hidden, including an unfinished final tail, while code examples stay literal. Native mobile runtime and a paid Codex turn were not exercised.

citation fragments stay hidden while streaming through the real client

This branch has not been deployed

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

Labels

📱 Native Change Changes the native fingerprint; merging blocks production OTAs until a new store build ships. size:XXL 1,000+ changed lines (additions + deletions). vouch:unvouched Author is not yet trusted in the VOUCHED list.

Projects

None yet

Development

Successfully merging this pull request may close these issues.