Skip to content
Source
Sign inSign up
pingdotgg/t3code

fix(web): make Windows file links clickable in chat #8081

Mergedt3dotgg(GitHub profile, opens in a new tab)merged 3 commits intomain fromrefs/pull/8081/headmerged by t3dotgg(GitHub profile, opens in a new tab) View on GitHub

Windows file links such as C:/Users/shawn/project/src/main.ts were not clickable in chat because Markdown sanitization treated the drive letter as an unsafe URL scheme.

Normalize Windows drive paths to already-allowed file: URLs during the existing Markdown tree traversal. Assistant and user messages, backslash paths, and reference links now open correctly without changing the sanitizer or adding another tree pass.

Thanks to @peculiarnewbie (#6237), @thiscallnet (#5283), @maslinedwin (#7182), and @CDVolvik (#7189) for their work and the implementations that informed this fix.

Verified with 69 focused tests, web typecheck, and targeted lint and formatting checks.

Model: GPT-5.6 Sol Harness: Codex in T3 Code


Note

Medium Risk Touches Markdown URL sanitization and link rewriting. Tests still reject javascript: and unknown schemes, but this is security-adjacent rendering.

Overview Makes Windows drive-letter file links in chat Markdown clickable. Sanitization previously treated C: as an unsafe scheme, so those hrefs were stripped.

The existing remark pass now rewrites matching link and definition URLs to file:/// with forward slashes before sanitize, covering assistant/user messages, backslash paths, and reference links. File-link disambiguation keys also normalize slashes so src\index.ts and test\index.ts still get distinct labels.

Unsafe schemes such as javascript: remain rejected.

Reviewed by [Cursor Bugbot](https://cursor.com/bugbot) for commit c458380a88bcbeb063b28ba27add5e879c1ee4c4. Bugbot is set up for automated code reviews on this repo. Configure [here](https://www.cursor.com/dashboard/bugbot).

Note

  • Adds WINDOWS_DRIVE_PATH_REGEX and rewrites markdown link, definition, and <img> src values that start with a Windows drive path to file:/// form with forward slashes via the renamed remarkNormalizeLinksAndTagInlineCode and rehypeNormalizeWindowsImageSrc plugins
  • Normalizes backslashes to forward slashes in buildFileLinkParentSuffixByPath, normalizeMarkdownLinkHrefKey, and the fileLinkChip helper so disambiguation suffixes and link keys match regardless of slash style
  • Preserves existing inline-code tagging behavior; code inside links is now skipped for tagging
  • Behavioral Change: markdown links and images with Windows drive paths are now rewritten to file:///C:/... before sanitization; out-of-tree consumers of CHAT_MARKDOWN_REMARK_PLUGINS will see the renamed/merged plugin replacing remarkTagInlineCode
Macroscope summarized c458380.
    1. coderabbitai[bot](GitHub profile, opens in a new tab)commented

      Important

      Review skipped

      Auto reviews are disabled on this repository. Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

      ⚙️ Run configuration

      Configuration used: Repository UI

      Review profile: CHILL

      Plan: Pro Plus

      Run ID: 06761d41-e9e7-4726-9e9d-12144a63bdf9

      You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

      Use the checkbox below for a quick retry:

      • 🔍 Trigger review

      Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

      ❤️ Share
      Comment `@coderabbitai help` to get the list of available commands.
    2. github-actions[bot](GitHub profile, opens in a new tab) added labelsvouch:trusted

    3. github-actions[bot](GitHub profile, opens in a new tab)commented

      Thread transfer impact

      ✅ Thread transfer remains within every enforced ceiling.

      ProviderMetricMain baselineThis PRImpactPR ceiling
      CodexTotal thread wire13.4 KiB13.4 KiB+11 B (+0.1%)15.1 KiB✅
      CodexThread snapshot wire6.9 KiB6.9 KiB+3 B (+0.0%)7.3 KiB✅
      CodexLive turn WebSocket wire6.5 KiB6.6 KiB+8 B (+0.1%)7.8 KiB✅
      CodexLive turn WebSocket decoded55.0 KiB55.0 KiB0 B (0.0%)66.4 KiB✅
      CodexLive turn messages16160 (0.0%)21✅
      ClaudeTotal thread wire13.5 KiB13.5 KiB+7 B (+0.1%)15.1 KiB✅
      ClaudeThread snapshot wire6.9 KiB6.9 KiB+10 B (+0.1%)7.3 KiB✅
      ClaudeLive turn WebSocket wire6.6 KiB6.6 KiB−3 B (−0.0%)7.8 KiB✅
      ClaudeLive turn WebSocket decoded55.8 KiB55.8 KiB0 B (0.0%)66.4 KiB✅
      ClaudeLive turn messages16160 (0.0%)21✅

      Baseline: e6a109b · PR result: c458380 · Source CI: success

      Scenario and decoded snapshot size

      10 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.

      • Codex decoded thread snapshot: 109.4 KiB
      • Claude decoded thread snapshot: 110.1 KiB

      Updated in place by a trusted workflow. PR artifacts are strictly validated and never executed.

    4. One consistency issue found in apps/web/src/components/ChatMarkdown.tsx: the new mdast URL normalization changes the rendered href for backslash-written Windows links, but the per-message file-link lookup keys are still derived from the raw markdown destination, so file-link chips can lose their disambiguating parent suffix.

      Posted via Macroscope — UI Consistency
    5. One finding: the new link-side separator normalization diverges from the inline-code path, which can add spurious disambiguation suffixes to file-link chips.

      Posted via Macroscope — UI Consistency
    6. Approvability

      Verdict: Approved at c458380

      Macroscope's review found this PR approvable — This is a focused ChatMarkdown bug fix that enables existing file-link handling for Windows drive paths and keeps path disambiguation consistent. Its runtime scope is limited to markdown rendering, with targeted coverage for both link formats and unsafe schemes.

      You can add or adjust custom eligibility rules. [Learn more](https://docs.macroscope.com/approvability#example-custom-eligibility-rules).

Sign in to join this conversation.