Repository navigation
fix(terminal): open file links Orca cannot display with the OS default app - #22388
registered2nd wants to merge 12 commits into
Conversation
There was a problem hiding this comment.
Important
The new plain-click route can launch local executables: BINARY_FILE_EXTENSIONS includes .exe (and other loadable artifacts) and shell.openPath executes a .exe on Windows. See the inline note — please confirm this is intended or exclude the executable subset before merging.
Reviewed changes
- Plain-click routing for binaries the editor cannot render —
openDetectedFilePathnow sends files matchinghasBinaryFileExtensionWithoutEditorViewerdown the OS-default path on an ordinary click: local files viawindow.api.shell.openFilePath, SSH/paired-runtime files via the existing download-and-open flow, with an editor fallback when the OS cannot open the file and no newer click superseded it. - New predicate —
hasBinaryFileExtensionWithoutEditorViewersubtracts the editor-viewable set (IMAGE_FILE_EXTENSIONS∪.pdf) fromBINARY_FILE_EXTENSIONS; thehasBinaryFileExtensionrefactor preserves prior behavior via the extractedlowerFileExtension. - Tests — new routing tests assert OS-open on plain click, editor fallback on a failed OS open, no stale editor tab after supersession, and that images/PDFs stay in the editor; SSH tests cover download-and-open and image passthrough; predicate tests cover case-insensitivity, Windows paths,
.tar.gz, SVG, dotfiles, and extensionless paths.
DeepSeek Flash (free via Pullfrog for OSS) | 𝕏
There was a problem hiding this comment.
Actionable comments posted: 1
ℹ️ Review info
⚙️ Run configuration
Configuration used: Repository UI
Review profile: CHILL
Plan: Advanced
Run ID: 1088de79-6d83-4b9d-a437-5bb3b232d48b
📥 Commits
Reviewing files that changed from the base of the PR and between bf3f952 and 61136282e27888cf59c6085acbd619a4f76c9dd4.
📒 Files selected for processing (5)
src/renderer/src/components/terminal-pane/terminal-file-open-routing.tssrc/renderer/src/components/terminal-pane/terminal-link-file-open-routing.test.tssrc/renderer/src/components/terminal-pane/terminal-link-remote-runtime-ssh-open.test.tssrc/shared/binary-file-extensions.test.tssrc/shared/binary-file-extensions.ts
Included review availability: Your plan provides up to 10 included reviews per hour; 9 remain after this review.
There was a problem hiding this comment.
✅ No new issues found.
Reviewed changes
- Executables excluded from the plain-click OS route —
binary-file-extensions.tssplits the non-image binary list intoOS_VIEWER_BINARY_EXTENSIONS(archives, audio/video, Office documents, fonts, including.pdf) andCOMPILED_AND_DATASTORE_EXTENSIONS(.exe,.dll,.so,.dylib,.node,.class,.jar,.war,.wasm, datastores).hasBinaryFileExtension's union is byte-for-byte unchanged, so its behavior is preserved; the newhasOsViewerOnlyFileExtension(OS_VIEWERminus.pdf) now drives the plain-click route. - Freshness guard for remote downloads —
downloadAndOpenRemoteTerminalFiletakes an optionalisRequestCurrent, checked after the download and beforeopenFilePath; both remote branches inopenDetectedFilePath(the new plain-click route and the pre-existing Shift+Cmd/Ctrl route) passrequestId === latestOpenDetectedFilePathRequestId. - Tests — new routing test asserts a plain click on
.exe/.jar/.dylibnever reaches the OS; predicate tests cover the compiled/loadable set; SSH routing and a new helper suite cover the supersede guard.
Verified locally: the 4 changed test files (41 tests), the existing caller suites (33 tests), and pnpm run typecheck:web all pass. The prior review's click-to-execute concern is resolved by 9749b05.
DeepSeek Flash (free via Pullfrog for OSS) | 𝕏
ee420a1 to
51676d8
Compare
d2f9324 to
f830320
Compare
64d0572 to
dcb8ad5
Compare
[Medium impact] Changes how terminal file links open based on file type. The PR is not yet safe to merge because two remote file paths can still end without a usable OS application or editor view. FindingsSummaryThis PR adds extension-based routing that opens otherwise undisplayable terminal and native-chat file links with the OS default application, while retaining Orca viewers for images and PDFs and excluding executable or loadable-code formats.
|
| await downloadAndOpenRemoteTerminalFile(fileContext, filePath, isRequestCurrent) | ||
| return true |
There was a problem hiding this comment.
Remote open failures disappear
When a remote file downloads successfully but the OS cannot open it, downloadAndOpenRemoteTerminalFile discards the false result from openFilePath. This branch then returns true, so routing stops without falling back to the editor or reporting an error. The user clicks the file, but neither the OS application nor an Orca tab opens it.
There was a problem hiding this comment.
Good catch, the download succeeds but a failed OS open went unreported, on the Shift+Cmd/Ctrl route as well. Fixed in 96c531e: when no app opens the saved file, a toast names where it was saved.
| if ( | ||
| !openWithSystemDefault && | ||
| !explicitGroupRequest && | ||
| hostGrant === null && |
There was a problem hiding this comment.
Granted binaries remain undisplayable
The hostGrant === null condition excludes grant-backed files from the new OS-viewer route. As a result, clicking an archive or video outside a paired runtime's workspace still opens an Orca editor tab that cannot display it. The existing remote download helper cannot consume the terminal artifact grant, so this paired-runtime case remains a dead end.
There was a problem hiding this comment.
Intended. A host grant serves only text and images, and the download helper can't read through a grant, so a granted binary keeps upstream's behavior and opens in Orca (6ca271f, hostGrant === null). Routing granted binaries to the OS would need a grant-backed download. That is a separate change, and I'd rather not widen this PR with it.
dcb8ad5 to
a22898f
Compare
1566891 to
12e7f39
Compare
…t app A plain click on a terminal or native-chat link to a binary the editor has no viewer for (video, audio, archives, Office documents, ...) used to open an editor tab that can only say "Binary file — cannot display". It now takes the Shift+Cmd/Ctrl route: local files open with the OS default app, SSH and paired-runtime files go through the existing download-and-open flow, and a failed OS open falls back to the editor unless a newer click superseded it. Images and PDFs keep their editor viewers.
…ale remote opens A plain click now sends only data files (archives, audio/video, Office documents, fonts) to the OS default app; executables, loadable code and datastores keep the editor tab. A remote download superseded by a newer click is no longer opened.
openFilePath now takes the owning execution host and the runtime file client barrel is gone. The plain-click OS-viewer branch moves to its own module so the routing file stays within its line limit.
A grant serves only text and images, so downloading a granted archive or video failed with an error toast. Granted files open in Orca again, as upstream does.
"Open in this group" now asks for an editor in the source tab's group, and upstream never substitutes a system app or download for it. The plain-click OS-viewer route skips that request, so a binary opens in the group as upstream does.
The editor open now takes a reveal callback as its fourth argument.
The router sits at upstream's 300-line limit at v1.4.241, and the plain-click OS-viewer route adds to it. Its option and failure types move out, as the open turn and HTML browser open did.
Upstream (stablyai#34119) replaced the grant id with the granted editor fields; a granted file still stays off the plain-click OS route. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…s it A remote file link opened with the default app is downloaded to the path the user picks and then handed to the OS. When no app takes it, the open failed silently: the copy was saved but nothing said so. A toast now names where the copy was saved. A newer link click during the download still skips the open and the toast. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…251 hosts page grants Upstream (stablyai#38693) downloads a granted file in pages and passes freshness as an option; a plain click on a granted archive or video now takes the same download, and opens in Orca when its host cannot page grants.
Upstream removed the SSH-open, host-workspace, binary-extension and most routing tests the branch added its cases to. The plain-click OS-viewer cases now live beside the route (terminal-link-os-viewer-open.test.ts) and the extension cases beside binary-file-extensions.ts. The beside-source case takes the open-path double the trimmed file no longer destructures.
…on context and language detection
12e7f39 to
439ce6e
Compare
|
Thanks for this and for the clear report in #39121. We went with a smaller step in #40971: the "Binary file — cannot display" tab gets an "Open with default app" / "Download & open" button, and plain clicks stay in Orca for now, since media files now play in Orca's own viewer and plugins can claim types like .xlsx. |
|
Thanks @registered2nd for pushing on this! We fixed it in #40971 with a slightly different shape: the "Binary file — cannot display" tab now has an "Open with default app" button ("Download & open" for remote files), so it works from terminal links, chat links, the file tree and quick open, and Orca still plays videos and audio itself. Your idea of never launching executables on a plain click stays in place. Closing this in favor of it. |

ELI5
When a terminal (or native chat) shows a link to a video, a zip or a Word file and you click it, Orca opens it in the code editor, which can only say "Binary file — cannot display". With this change, clicking a link to a file Orca has no viewer for opens it in the app your computer uses for that kind of file. Images and PDFs still open in Orca's own viewers.
What Changed
Before: a plain Cmd/Ctrl-click (or the popover's "Open file") on a
.mp4,.mov,.wav,.zip,.docx,.pptx… link opens an editor tab showing "Binary file — cannot display". The only way to actually open the file is the separate Shift+Cmd/Ctrl gesture or the popover's "Open with default app" row.After: the same plain click routes those files through the path Shift+Cmd/Ctrl already uses:
shell.openFilePath);Executables and other loadable code (
.exe,.dll,.so,.dylib,.node,.jar,.class,.wasm, …) and datastores are left out: a plain click on them still opens the editor tab, so an ordinary click never runs a program. Shift+Cmd/Ctrl behaves as before.Mechanism:
openDetectedFilePath(shared by terminal links and native-chat file links) checks a newhasOsViewerOnlyFileExtensionbeforestore.openFile. It is defined next tohasBinaryFileExtensioninsrc/shared/binary-file-extensions.ts, which now splits the non-image binary list into two groups: data files the OS opens in a viewer app (archives, audio/video, Office documents, fonts) and compiled code plus datastores. Only the first group, minus.pdf(which the editor renders), takes the new route; the union of both groups is unchanged, sohasBinaryFileExtensionbehaves as before.downloadAndOpenRemoteTerminalFiletakes an optional freshness check, which both remote-download calls inopenDetectedFilePathpass, and raises the toast whenopenFilePathreturnsfalse, on the Shift+Cmd/Ctrl route as well. Text files, SVG, images, PDFs, HTML and directories are untouched, and the explicit Shift+Cmd/Ctrl gesture keeps its current behavior.Why
A click on a file the editor cannot show always ends in a dead-end tab. Every request touching this points the same way: #18124 asks for "open in native app" for binary files Orca doesn't handle, #14813 asks for the OS default app to be reachable as the primary click for file links, and #13993 / #13994 add the equivalent in the file explorer.
Alternatives considered:
hasBinaryFileExtension), and a misclassified file still falls back to the editor.Linked Issue
Fixes #39121. Related: #18124, #14813, #13993.
Visual Proof
Not attached: this is a routing change with no new UI. Before, the click shows the existing "Binary file — cannot display" editor tab; after, the file opens in the OS app for its type and no Orca tab appears. Covered by the tests below.
Testing
pnpm test src/shared/binary-file-extensions.test.ts src/renderer/src/components/terminal-pane/terminal-link-file-open-routing.test.ts src/renderer/src/components/terminal-pane/terminal-link-remote-runtime-ssh-open.test.ts src/renderer/src/components/terminal-pane/terminal-remote-file-download-open.test.ts— 41 passed.New tests: local plain click on an
.mp4opens with the default app and no editor tab; failed OS open falls back to the editor; a superseded binary click does not open a stale editor tab; images and PDFs stay in the editor viewers; SSH plain click on an.mp4goes through download-and-open; SSH images stay in the editor; a plain click on.exe/.jar/.dllopens the editor tab and never the OS; a remote download superseded by a newer click is not opened (routing and helper); a downloaded copy no app opens raises the toast; predicate cases (case-insensitive, Windows paths,.tar.gz, SVG, dotfiles, extensionless).Reverting the routing branch makes the four behavior tests fail.
pnpm tcpasses;pnpm run check:code-quality:changedreports 0 new findings;oxfmt --checkand the pre-commit hooks are clean.vitest run src/renderer/src/components/terminal-pane src/renderer/src/components/native-chat src/renderer/src/components/browser-pane/workspace-doc src/shared/binary-file-extensions.test.ts: 654 files / 6369 tests pass.Full
pnpm lintpasses every step up toverify:skill-bundle-manifest, which fails identically on untouchedmainin this Windows checkout (CRLF line endings); the localization checks after it pass when run individually. Fullpnpm teston this Windows machine has pre-existing failures in unrelated areas (Linux packaging, native rebuilds, CRLF-sensitive config scripts); none are in the files this touches.pnpm buildnot run locally — leaving the full matrix to CI.Platforms: Windows (unit tests). Not manually exercised in a built app on macOS/Linux or against a live SSH host; the SSH path reuses the existing download-and-open helper.
I manually tested these changes locally
Automated tests added/updated, or explained why not below
AI Disclosure
Written with Claude Code (Anthropic's Claude).
Review
shell.openFilePath, already the cross-platform path for the Shift gesture; extension parsing handles/and\separators.authorizeExternalPath+statalready performed before this point. A plain click only reaches the OS for data-file types; executables and loadable code stay on the editor tab.Agent skill upstream boundary
docs/reference/agent-skill-sharing-upstream-boundary.mdand copies or mechanically translates no upstream skill-installer source, tests, fixtures, registry entries, path tables, comments, or documentation.Notes
Ensure no issues in: Security, Cross-platoform support (Linux, Windows, Mac), Remote SSH, Mobile, general backwards compatibility, performance
Mobile is unaffected: this path runs in the desktop renderer only.
Checklist
N/Awith reasonpnpm lint,pnpm typecheck,pnpm test, andpnpm buildpass (or CI will cover; local preferred)