You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
fix(native-chat): open Dockerfile:2-style links to extensionless files - #52741
When an agent's chat message links to a spot in a file with no extension, like Dockerfile:2 or Makefile:10:3, clicking the link now opens that file at that line. Before, Orca mistook the link for a web address like mailto: and did nothing.
What Changed
Before:routeNativeChatHref('Dockerfile:2') returned { kind: 'none' }. Dockerfile: matches the URL-scheme pattern. The only bare-file exception, BARE_FILE_LOCATION_PATTERN, needs an extension (README.md:5). Desktop and mobile chat both rendered the link with nowhere to go.
After: the shared href router also treats <known extensionless filename>:<line>[:<col>] as a file location. It parses the value with the existing parseFileLinkLocation and checks the filename against the list the terminal link detector already uses (Makefile, Dockerfile, README, LICENSE, ...). That list now lives in src/shared/file-links/extensionless-filenames.ts, so terminal and chat share one source.
Values that don't match the scheme pattern skip the new check entirely (SCHEME_PATTERN is tested first), so ordinary relative paths pay nothing extra.
Unchanged: localhost:3000, vscode:extension/x, https:/mailto:, lowercase dockerfile:2, Dockerfile:x, Dockerfile:2#L5, Makefile:10:3:4, and Dockerfile: all route exactly as before.
Why
The root cause is the router's scheme check. It had a file-location exception for names with an extension but none for well-known extensionless names. Fixing it in the shared router fixes desktop and mobile Markdown in one place. The alternative was rewriting destinations separately in each Markdown parser, which needed two parser changes and a second code path. The exact filename list plus numeric line validation keeps host/port text and custom schemes away from file routing.
N/A for screenshots: no UI changes, only where an existing chat link goes when clicked. The behavior proof is a router probe run against main and this branch. It covers the desktop bracket, autolink and reference Markdown paths, POSIX and Windows path resolution, the terminal detector and the mobile router:
Automated tests added/updated, or explained why not below
Every added test fails without this change and avoids the test anti-patterns
I reproduced the bug on main with the router probe above (Dockerfile:2 → { kind: 'none' }), then checked the same inputs on this branch.
New regression test native-chat-href-routing.test.ts checks that Dockerfile:2 routes as a file and localhost:3000 does not. It fails on main and passes here.
Targeted vitest on src/shared/native-chat/file-access/, src/shared/terminal/links/ and src/shared/file-links/ passed (48 tests). Neighboring Markdown/link suites also passed (84 tests).
Anti-slop oxlint, code-quality oxlint, ast-grep, the changed-code quality gate and oxfmt are clean on the touched files.
Platforms: macOS (unit and probe). The probe also resolves Windows-style C:/repo roots. The change is pure string routing in src/shared, so it doesn't depend on platform or SSH.
Performance
None that matters. The router only runs when a chat link renders or is clicked, which is not a hot path. Microbenchmarks, old vs new per call: https 20.3 vs 20.6 ns, relative path 164 vs 171 ns, README.md:5 158 vs 157 ns, localhost:3000 62 vs 88 ns, vscode: 56 vs 77 ns. Newly routed Dockerfile:2 costs 205 ns. The worst adversarial input, a long Dockerfile: tail, takes about 0.1 ms per call, well under one frame. There is no new I/O, subprocess, polling or per-item fan-out.
Risk
Level: Low
The riskiest part is a scheme-like href being read as a file. Only exact, case-sensitive names from the existing terminal list with a numeric line qualify, and the host still validates file access as before. Older paired phones and SSH hosts are unaffected because nothing changes on the wire. To back it out, a plain revert works. There is no saved data or settings.
Agent skill upstream boundary
Not applicable, or this change copies or mechanically translates no upstream skill-installer source, tests, fixtures, registry entries, path tables, comments, or documentation.
Notes
Original fix by @SeungWoonSong in #52741. During review we moved the fix from the two Markdown parsers into the shared href router and reused parseFileLinkLocation. The extracted shared filename list and the terminal refactor are from the original patch, and authorship is kept on the commit.
Checklist
This PR is small and focused
I explained what changed and why (ELI5, the user-facing before/after, the mechanism, and why over the alternatives)
I stated the risk: what could break, for whom, and how to back it out
Before/after screenshots or videos attached for UI changes, or N/A with reason
Self-reviewed for correctness, security, and performance
Cross-platform, SSH/remote, and path/shortcut impact considered (or N/A)
pnpm lint, pnpm typecheck, pnpm test, and pnpm build pass (or CI will cover; local preferred)
The changes add a shared check for known extensionless filenames and use it in terminal bare-file detection. Native chat routing now allows recognized extensionless filenames with line locations, such as Dockerfile:2, to continue through file-path handling. A test covers Dockerfile:2 and localhost:3000.
Severity of issue fixed: Medium
Merge Risk: Low · up to b7a2f
Links to files like Dockerfile with a line number now open at the requested line in native chat. The change also turns bare autolinks such as <Dockerfile:2> into file links, which the PR says should not happen. The effect is narrow and the fallback is safe, so this is mergeable with the follow-up noted.
Pre-merge checks: 3 · 1
Failed checks: 1 inconclusive
Check name
Status
Explanation
Resolution
Linked Issues check
Issue #52740 requires that [Dockerfile](Dockerfile:2) open Dockerfile at line 2 on desktop Linux, and that the mobile Markdown pipeline resolve the bare destination to a file target. At the reviewed…
Show that the desktop and mobile Markdown link paths pass Dockerfile:2 destinations to routeNativeChatHref, and that the resulting file route opens line 2. Show the code that parses the line from pathText when line is null, or set t…
Passed checks: 3 passed
Check name
Status
Explanation
Out of Scope Changes check
All changed files connect to the file-link objective of #52740. extensionless-filenames.ts adds the shared filename list. terminal-bare-file-link-detection.ts replaces its local set with the same …
Title check
The title names the main change: native-chat links to extensionless files such as Dockerfile:2 now open the file. It matches the raw summary, which shows the router now routes known extensionless file…
Description check
The description follows the template and fills every required section: ELI5, What Changed, Why, Linked Issue (Fixes #52740), Visual Proof (N/A with reason and a router probe table), Testing, Performan…
Full details: Out of Scope Changes check
Explanation
All changed files connect to the file-link objective of #52740. extensionless-filenames.ts adds the shared filename list. terminal-bare-file-link-detection.ts replaces its local set with the same twelve names, so terminal behavior does not change. native-chat-href-routing.ts adds the known-filename, parsed-line exception that the issue needs. The router test covers the new case and localhost:3000. The router change applies to all callers, not only Markdown links. The PR description says the shared router contract is unchanged. That statement does not match the head diff. This mismatch is a description issue, not an unrelated change.
Full details: Title check
Explanation
The title names the main change: native-chat links to extensionless files such as Dockerfile:2 now open the file. It matches the raw summary, which shows the router now routes known extensionless filenames with line locations to file routing, and the added test for Dockerfile:2. The title is specific and concise.
Full details: Description check
Explanation
The description follows the template and fills every required section: ELI5, What Changed, Why, Linked Issue (Fixes #52740), Visual Proof (N/A with reason and a router probe table), Testing, Performance ("None, because" with measurements), Risk (Level: Low, with a revert path), Agent skill boundary, Notes, and Checklist. The Linked Issue section is complete. The AI Disclosure section is empty, which the template allows for internal members. The Review section is empty. The template's Review heading is unfilled but is not a required field.
Full details: Linked Issues check
Explanation
Issue #52740 requires that [Dockerfile](Dockerfile:2) open Dockerfile at line 2 on desktop Linux, and that the mobile Markdown pipeline resolve the bare destination to a file target. At the reviewed head, the whole-PR diff (merge base 0050f4a to head b7a2fc5) changes only these files: extensionless-filenames.ts (new), native-chat-href-routing.ts, terminal-bare-file-link-detection.ts, and the router test. The Markdown destination files and mobile-markdown-tree.ts named in the previous assessment and the PR description are not in this diff. Desktop evidence: routeNativeChatHref('Dockerfile:2') no longer returns none. The new check admits the destination as a file, and the router test expects { kind: 'file', pathText: 'Dockerfile:2', line: null }. The router does not set line 2. Whether the file-open path parses the line from pathText is not shown in the diff. Mobile evidence: no mobile file changed. It is unknown whether the mobile Markdown pipeline calls routeNativeChatHref. Also, the router has no link-versus-autolink input, so the PR description's claim that autolinks stay on the scheme path is not established at the router level. The previous PASS relied on code that is no longer in this PR.
Resolution
Show that the desktop and mobile Markdown link paths pass Dockerfile:2 destinations to routeNativeChatHref, and that the resulting file route opens line 2. Show the code that parses the line from pathText when line is null, or set the line in the route result. Provide the mobile pipeline evidence for [Dockerfile](Dockerfile:2), or the mobile change that handles it. Provide a regression test for the rendered link target or the open-at-line behavior.
Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts
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.
Chat links such as `Dockerfile:2` or `Makefile:10:3` matched the URL
scheme pattern, and the bare file-location exception required an
extension, so the shared href router dropped them. The router now also
treats a known extensionless filename followed by a numeric line
(validated by parseFileLinkLocation) as a file location, and the
terminal and chat share one extensionless-filename list. Host/port text
such as `localhost:3000` and custom schemes still route as before.
Fixesstablyai#52740
Co-authored-by: Neil <[email protected]>
nwparker
changed the title
fix(native-chat): open extensionless file location links
fix(native-chat): open Dockerfile:2-style links to extensionless files
Nov 30, 2026
The reason will be displayed to describe this comment to others. Learn more.
Autolinks now open workspace files
routeNativeChatHref now treats Dockerfile:2 as a file everywhere, including CommonMark autolinks such as <Dockerfile:2>. Desktop rewrites every matching link destination, and mobile sends every link href to this router without checking how it was written. Clicking the autolink therefore opens a workspace file instead of keeping the previous scheme behavior.
This is a non-blocking change beyond the PR’s explicit-link-only scope. Move the exception to the Markdown parsers, where authored destinations can be distinguished from autolinks.
134-134: Minor · Functional Correctness · Poor tradeoff
Keep bare extensionless locations out of the shared router's direct result.
routeNativeChatHref('Dockerfile:2') now returns a file route. Before this guard, the same input returned none. The PR states that the shared router keeps its existing contract, so this direct change conflicts with that statement.
The change also reaches autolinks on desktop. rewriteFileDestinations calls fileRewrite(node.url) for every link node. A CommonMark autolink such as <Dockerfile:2> produces a link node with Dockerfile:2 as its URL. The router now admits that URL, so the autolink becomes a file link. The PR states that bare extensionless autolinks stay on the scheme-handling path.
The fix needs more than removing the guard. Explicit links such as [Dockerfile](Dockerfile:2) depend on the same router result to become file links. Restrict the bare-location rule to explicit Markdown link destinations. Keep <Dockerfile:2> and bare Dockerfile:2 on the scheme path. The author must choose how the boundary tells autolinks from explicit destinations.
Review info
Run configuration
Source mode: Auto
Repository: Unavailable
Branch: Unavailable
File: No configuration file from this repository applied
Commit: Unavailable
Layers: Repository UI
Review profile: CHILL
Plan: Advanced
Run ID: 8389aa61-8578-4cc9-bd11-a16050cd8e9f
Commits
Reviewing files that changed from the base of the PR and between 0f39f0b and b7a2fc5.
Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 9 remain after this review.
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
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.
ELI5
When an agent's chat message links to a spot in a file with no extension, like
Dockerfile:2orMakefile:10:3, clicking the link now opens that file at that line. Before, Orca mistook the link for a web address likemailto:and did nothing.What Changed
routeNativeChatHref('Dockerfile:2')returned{ kind: 'none' }.Dockerfile:matches the URL-scheme pattern. The only bare-file exception,BARE_FILE_LOCATION_PATTERN, needs an extension (README.md:5). Desktop and mobile chat both rendered the link with nowhere to go.<known extensionless filename>:<line>[:<col>]as a file location. It parses the value with the existingparseFileLinkLocationand checks the filename against the list the terminal link detector already uses (Makefile,Dockerfile,README,LICENSE, ...). That list now lives insrc/shared/file-links/extensionless-filenames.ts, so terminal and chat share one source.SCHEME_PATTERNis tested first), so ordinary relative paths pay nothing extra.localhost:3000,vscode:extension/x,https:/mailto:, lowercasedockerfile:2,Dockerfile:x,Dockerfile:2#L5,Makefile:10:3:4, andDockerfile:all route exactly as before.Why
The root cause is the router's scheme check. It had a file-location exception for names with an extension but none for well-known extensionless names. Fixing it in the shared router fixes desktop and mobile Markdown in one place. The alternative was rewriting destinations separately in each Markdown parser, which needed two parser changes and a second code path. The exact filename list plus numeric line validation keeps host/port text and custom schemes away from file routing.
Linked Issue
Fixes #52740
Visual Proof
N/A for screenshots: no UI changes, only where an existing chat link goes when clicked. The behavior proof is a router probe run against
mainand this branch. It covers the desktop bracket, autolink and reference Markdown paths, POSIX and Windows path resolution, the terminal detector and the mobile router:Dockerfile:2none/repo/Dockerfileline 2Makefile:10:3none/repo/Makefileline 10 col 3README:1,Gemfile:1,Procfile:1,NOTICE:3:1noneREADME.md:5,./Dockerfile:2,src/Dockerfile:2localhost:3000,vscode:extension/xnonenone(unchanged)https://x.dev,mailto:[email protected]dockerfile:2,Dockerfile:x,Dockerfile:2#L5,Makefile:10:3:4,Dockerfile:-1nonenone(unchanged)Testing
I manually tested these changes locally
Automated tests added/updated, or explained why not below
Every added test fails without this change and avoids the test anti-patterns
I reproduced the bug on
mainwith the router probe above (Dockerfile:2→{ kind: 'none' }), then checked the same inputs on this branch.New regression test
native-chat-href-routing.test.tschecks thatDockerfile:2routes as a file andlocalhost:3000does not. It fails onmainand passes here.Targeted vitest on
src/shared/native-chat/file-access/,src/shared/terminal/links/andsrc/shared/file-links/passed (48 tests). Neighboring Markdown/link suites also passed (84 tests).Anti-slop oxlint, code-quality oxlint, ast-grep, the changed-code quality gate and oxfmt are clean on the touched files.
Platforms: macOS (unit and probe). The probe also resolves Windows-style
C:/reporoots. The change is pure string routing insrc/shared, so it doesn't depend on platform or SSH.Performance
None that matters. The router only runs when a chat link renders or is clicked, which is not a hot path. Microbenchmarks, old vs new per call:
https20.3 vs 20.6 ns, relative path 164 vs 171 ns,README.md:5158 vs 157 ns,localhost:300062 vs 88 ns,vscode:56 vs 77 ns. Newly routedDockerfile:2costs 205 ns. The worst adversarial input, a longDockerfile:tail, takes about 0.1 ms per call, well under one frame. There is no new I/O, subprocess, polling or per-item fan-out.Risk
Level: Low
The riskiest part is a scheme-like href being read as a file. Only exact, case-sensitive names from the existing terminal list with a numeric line qualify, and the host still validates file access as before. Older paired phones and SSH hosts are unaffected because nothing changes on the wire. To back it out, a plain revert works. There is no saved data or settings.
Agent skill upstream boundary
Notes
Original fix by @SeungWoonSong in #52741. During review we moved the fix from the two Markdown parsers into the shared href router and reused
parseFileLinkLocation. The extracted shared filename list and the terminal refactor are from the original patch, and authorship is kept on the commit.Checklist
N/Awith reasonpnpm lint,pnpm typecheck,pnpm test, andpnpm buildpass (or CI will cover; local preferred)