feat(web): open files in containing folder - #5366
Conversation
ApprovabilityVerdict: Needs human review 1 blocking correctness issue found. New feature adding "reveal in file manager" functionality with new RPC endpoint, platform detection logic, capability flag, and UI integration. New user-facing features require human review. Additionally, an unresolved High-severity finding about regex edge cases warrants attention. You can customize Macroscope's approvability policy. Learn more. |
c5ce623 to
71d99ee
Compare
47284e0 to
316bb7d
Compare
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes using high effort and found 1 potential issue.
❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.
Reviewed by Cursor Bugbot for commit 316bb7d. Configure here.
1ff7da7 to
0647b60
Compare
0647b60 to
8709943
Compare
| const RELATIVE_FILE_NAME_PATTERN = /^[A-Za-z0-9._ -]+\.[A-Za-z0-9_-]+(?::\d+){0,2}$/; | ||
| const POSITION_SUFFIX_PATTERN = /:\d+(?::\d+)?$/; | ||
| const POSITION_ONLY_PATTERN = /^\d+(?::\d+)?$/; | ||
| const MARKDOWN_LINK_HREF_PATTERN = /\[[^\]]*]\(\s*(<[^>\n]+>|[^)\s]+)(?:\s+["'][^"']*["'])?\s*\)/g; |
There was a problem hiding this comment.
🟠 High src/markdown-links.ts:12
MARKDOWN_LINK_HREF_PATTERN fails to extract valid markdown link destinations that contain a literal ), such as [file](src/foo(bar).ts). The regex stops at the first ), so extractMarkdownLinkHrefs omits the href and the link renders as an ordinary link instead of a file chip. Consider handling balanced parentheses in the destination (e.g., counting nested ( ) or matching the closing ) at depth zero).
🚀 Reply "fix it for me" or copy this AI Prompt for your agent:
In file @apps/web/src/markdown-links.ts around line 12:
`MARKDOWN_LINK_HREF_PATTERN` fails to extract valid markdown link destinations that contain a literal `)`, such as `[file](src/foo(bar).ts)`. The regex stops at the first `)`, so `extractMarkdownLinkHrefs` omits the href and the link renders as an ordinary link instead of a file chip. Consider handling balanced parentheses in the destination (e.g., counting nested `(` `)` or matching the closing `)` at depth zero).
Thread transfer impact✅ Thread transfer remains within every enforced ceiling.
Baseline: Scenario and decoded snapshot size10 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.
Updated in place by a trusted workflow. PR artifacts are strictly validated and never executed. |


problem
file link context menus can open files in editors or copy their paths, but cannot reveal them in the host file manager.
fix
testing
GOMAXPROCS=2 pnpm --filter @t3tools/contracts typecheckGOMAXPROCS=2 pnpm --filter @t3tools/client-runtime typecheckGOMAXPROCS=2 pnpm --filter t3 typecheckGOMAXPROCS=1 pnpm --filter @t3tools/web typecheckGOMAXPROCS=2 pnpm --filter t3 exec vp test run src/process/externalLauncher.test.tsGOMAXPROCS=2 pnpm --filter t3 exec vp test run src/server.test.ts -t "routes websocket rpc shell.revealInFileManager"model: gpt-5.4
harness: t3bot
Note
Medium Risk
Spawns host file-manager processes from server-side paths and adds session/env heuristics (SSH, headless Linux, WSL); mistakes could expose the action where it cannot work or launch unexpected commands, but scope matches existing shell operate RPCs and unsupported cases are rejected.
Overview
Adds Open in folder for markdown file links in chat, routed through a new
shell.revealInFileManagerRPC on the thread’s environment (same operate scope as open-in-editor).The server exposes
fileManagerRevealand implementsExternalLauncher.revealInFileManagerwith platform-specific behavior: Finder-R/ Explorer/select,when the path exists, otherwise the parent folder; Linux usesxdg-openon the directory. File-manager availability is gated on a graphical session (DISPLAY/Wayland, not SSH, not Windows Services, WSL without WSLg usesexplorer.exewith UNC paths).The web UI shows the context-menu action only when connected, the capability is advertised, and
file-manageris inavailableEditors. Link parsing now handles paths with spaces and angle-bracket destinations; reveal uses resolvedfilePathrather than editortargetPath.Reviewed by Cursor Bugbot for commit 8709943. Bugbot is set up for automated code reviews on this repo. Configure here.
Note
Add 'Open in folder' file manager reveal action to chat file links
shell.revealInFileManagerWebSocket RPC that spawns the OS file manager to select a file or open its containing folder, with platform-specific handling for macOS (-R), Windows (/select,), Linux (xdg-open), and WSL (explorer.exe with UNC paths).fileManagerRevealcapability and a compatible editor is available.📊 Macroscope summarized 8709943. 11 files reviewed, 0 issues evaluated, 0 issues filtered, 0 comments posted
🗂️ Filtered Issues
No issues evaluated.