Skip to content

fix(web): stop linking kernel pseudo-filesystem paths in chat markdown - #5380

Open
DAlperin wants to merge 1 commit into
pingdotgg:mainfrom
DAlperin:fix-markdown-pseudo-fs-chips
Open

fix(web): stop linking kernel pseudo-filesystem paths in chat markdown#5380
DAlperin wants to merge 1 commit into
pingdotgg:mainfrom
DAlperin:fix-markdown-pseudo-fs-chips

Conversation

@DAlperin

@DAlperin DAlperin commented Aug 5, 2026

Copy link
Copy Markdown

What Changed

POSIX_FILE_ROOT_PREFIXES in apps/web/src/markdown-links.ts listed /dev/, /proc/, /sys/, /run/, and /boot/ alongside the ordinary filesystem roots. Anything under one of those roots cleared looksLikePosixFilesystemPath, so the inline-code linkifier turned it into a file chip. This drops those five roots from the list. Nothing else about the heuristic changes.

Two tests are added, one for resolveMarkdownFileLinkTarget and one for resolveInlineCodeFileLinkMeta, covering /dev/kvm, /dev/null, /proc/cpuinfo, and /sys/class/net/eth0.

Why

An assistant message that mentions /dev/kvm renders it as a clickable chip labeled "kvm" with a folder icon — the path is a device node, the label drops the directory, and clicking it tries to open something no editor wants. /dev/null shows up constantly in agent output and hits the same path.

The chips for real files are the point of the feature, so the fix is scoped to the roots that never hold editable files. Entries under a dropped root still link when they carry a file extension or a :line suffix (/run/user/1000/app.sock), which is the generic rule the rest of the heuristic already uses.

UI Changes

Before

before

After

after

Checklist

  • This PR is small and focused
  • I explained what changed and why
  • I included before/after screenshots for any UI changes
  • I included a video for animation/interaction changes

Note

Low Risk
Narrow heuristic tweak in chat markdown link detection with regression tests; no auth, data, or API surface changes.

Overview
Chat markdown was treating paths under /dev/, /proc/, /sys/, /run/, and /boot/ as normal POSIX file roots, so mentions like /dev/null or /proc/cpuinfo showed up as clickable file chips and tried to open in the editor.

This change drops those five prefixes from POSIX_FILE_ROOT_PREFIXES in markdown-links.ts and documents that excluded roots can still link when the path has a file extension or :line suffix. Tests cover resolveMarkdownFileLinkTarget and resolveInlineCodeFileLinkMeta for typical device and kernel paths.

Reviewed by Cursor Bugbot for commit 77c58f0. Bugbot is set up for automated code reviews on this repo. Configure here.

Note

Stop linking kernel pseudo-filesystem paths in chat markdown

Removes /dev/, /proc/, /sys/, /run/, and /boot/ from POSIX_FILE_ROOT_PREFIXES in markdown-links.ts so paths like /dev/null or /proc/cpuinfo are no longer rendered as file links. Paths under these roots that have a file extension or :line suffix are still linkable.

Macroscope summarized 77c58f0.

Inline code like `/dev/kvm` rendered as a clickable file chip labeled "kvm", because /dev, /proc, /sys, /run, and /boot sat on the POSIX root allowlist that marks an absolute path as a filesystem path. Their entries are device nodes, kernel state, and boot images rather than files worth opening in an editor, so drop those roots.

Entries under a dropped root still link when they carry a file extension or a :line suffix, and every other root is unchanged: /usr/local/bin/tool, /etc/hosts, and workspace-relative paths keep their chips.
@coderabbitai

coderabbitai Bot commented Aug 5, 2026

Copy link
Copy Markdown

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: 6c2b6be1-923c-4c78-947c-4051efad0789

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.

@github-actions github-actions Bot added size:S 10-29 changed lines (additions + deletions). vouch:unvouched PR author is not yet trusted in the VOUCHED list. labels Aug 5, 2026
@macroscopeapp

macroscopeapp Bot commented Aug 5, 2026

Copy link
Copy Markdown
Contributor

Approvability

Verdict: Approved 77c58f0

Simple bug fix that removes kernel pseudo-filesystem paths (/dev/, /proc/, /sys/, /run/, /boot/) from the allowlist of linkable file paths. The change only affects markdown link rendering in chat UI and includes test coverage.

You can customize Macroscope's approvability policy. Learn more.

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

Labels

size:S 10-29 changed lines (additions + deletions). vouch:unvouched PR author is not yet trusted in the VOUCHED list.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant