Skip to content

fix(terminal): open file links Orca cannot display with the OS default app - #22388

Closed
registered2nd wants to merge 12 commits into
stablyai:mainfrom
registered2nd:fix/open-unviewable-binary-links-with-default-app
Closed

registered2nd wants to merge 12 commits into
stablyai:mainfrom
registered2nd:fix/open-unviewable-binary-links-with-default-app

Conversation

@registered2nd

@registered2nd registered2nd commented Sep 23, 2026 •

Copy link
Copy Markdown
Contributor

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:

  • local files open with the OS default app (shell.openFilePath);
  • SSH and paired-runtime files go through the existing "Download & open with default app" flow, since the client OS cannot launch a remote path;
  • if the OS reports it could not open the file, the click falls back to today's editor tab, unless a newer click has superseded it;
  • a remote download that finishes after a newer click is not opened;
  • when no app opens a downloaded copy, a toast names where it was saved.

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 new hasOsViewerOnlyFileExtension before store.openFile. It is defined next to hasBinaryFileExtension in src/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, so hasBinaryFileExtension behaves as before. downloadAndOpenRemoteTerminalFile takes an optional freshness check, which both remote-download calls in openDetectedFilePath pass, and raises the toast when openFilePath returns false, 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:

  • A setting to swap the plain and Shift chords for all file links ([Feature]: Terminal file-link hints and settings are inconsistent #14813). Broader and still sends text files out of Orca; this change only affects files the editor provably cannot display, so it needs no setting.
  • A new video/audio viewer in the editor. Much larger, and would not help archives or Office documents.
  • Content sniffing instead of extensions. The routing decision happens before any read; the extension list is the one Orca already uses for this guess (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 .mp4 opens 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 .mp4 goes through download-and-open; SSH images stay in the editor; a plain click on .exe / .jar / .dll opens 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 tc passes; pnpm run check:code-quality:changed reports 0 new findings; oxfmt --check and 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 lint passes every step up to verify:skill-bundle-manifest, which fails identically on untouched main in this Windows checkout (CRLF line endings); the localization checks after it pass when run individually. Full pnpm test on 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 build not 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

  • Cross-platform: uses shell.openFilePath, already the cross-platform path for the Shift gesture; extension parsing handles / and \ separators.
  • SSH / remote / local: local paths use the OS app; SSH and paired-runtime paths use the existing download flow (native save dialog; cancelling is a no-op). WSL paths keep their existing mapping and count as local, as for the Shift gesture.
  • Agents / integrations: provider-neutral; native-chat file links share the same opener and get the same behavior.
  • Performance: one extension check per click; no extra IPC for text files.
  • Security: no new IPC or file access; reuses authorizeExternalPath + stat already performed before this point. A plain click only reaches the OS for data-file types; executables and loadable code stay on the editor tab.
  • UI: no visual change.

Agent skill upstream boundary

  • Not applicable, or this change follows docs/reference/agent-skill-sharing-upstream-boundary.md and 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

  • 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)
  • 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)

@pullfrog pullfrog Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 — openDetectedFilePath now sends files matching hasBinaryFileExtensionWithoutEditorViewer down the OS-default path on an ordinary click: local files via window.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 — hasBinaryFileExtensionWithoutEditorViewer subtracts the editor-viewable set (IMAGE_FILE_EXTENSIONS ∪ .pdf) from BINARY_FILE_EXTENSIONS; the hasBinaryFileExtension refactor preserves prior behavior via the extracted lowerFileExtension.
  • 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.

Pullfrog  | Fix all ➔ | Fix 👍s ➔ | View workflow run | Using DeepSeek Flash (free via Pullfrog for OSS) | 𝕏

@coderabbitai

coderabbitai Bot commented Sep 23, 2026 •

Copy link
Copy Markdown
Contributor

Review in Change Stack →

Important

Review skipped

We couldn't safely recover the incremental review. No full review was started, and the last reviewed checkpoint was preserved. Retry later, or explicitly request a full review by commenting @coderabbitai full review.

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

No actionable comments were generated in the recent review.

Walkthrough

A shared extension helper identifies binary files that lack an editor viewer. Ordinary clicks on those files use the system opener when the file is local, or download and open the file when it is remote. If the local system opener fails, the click falls back to the editor unless a newer request supersedes it. Remote downloads also skip opening the downloaded file when a newer request supersedes them. Tests cover these routes and confirm that images and PDFs remain in editor viewers.

Merge Risk: Minimal · previous review 9749b

Local files fall back to the editor when system opening fails, and superseded remote downloads no longer open after a newer click. The changed routing is ready to merge.

Pre-merge checks: Passed 4

Check name Status Explanation
Linked Issues check Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check Passed Check skipped because no linked issues were found for this pull request.
Title check Passed The title names the main change: plain clicks on file links Orca cannot display now open in the OS default app. It follows the conventional commit format and is concise. The changeset matches it: open…
Description check Passed The description is mostly complete. It lacks before-and-after visual proof and a Risk section with a risk level, potential impact, and rollback plan.
Full details: Title check

Explanation

The title names the main change: plain clicks on file links Orca cannot display now open in the OS default app. It follows the conventional commit format and is concise. The changeset matches it: openDetectedFilePath routes such files to the OS app, and the helper hasOsViewerOnlyFileExtension is added with tests.

  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts
ℹ️ Recent review info

⚙️ Run configuration

Configuration used: Repository UI

Review profile: CHILL

Plan: Advanced

Run ID: 1dee9e25-a11f-4a67-ad52-f9863cfddd08

📥 Commits

Reviewing files that changed from the base of the PR and between 61136282e27888cf59c6085acbd619a4f76c9dd4 and 9749b05597772e42aec3e0862968070b93384516.

📒 Files selected for processing (7)

  • src/renderer/src/components/terminal-pane/terminal-file-open-routing.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
  • src/renderer/src/components/terminal-pane/terminal-remote-file-download-open.ts
  • src/shared/binary-file-extensions.test.ts
  • src/shared/binary-file-extensions.ts

Included review availability: Your plan provides up to 10 included reviews per hour; 9 remain after this review.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.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/shared/binary-file-extensions.test.ts
  • src/shared/binary-file-extensions.ts

Included review availability: Your plan provides up to 10 included reviews per hour; 9 remain after this review.

@pullfrog pullfrog Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

✅ No new issues found.

Reviewed changes

  • Executables excluded from the plain-click OS route — binary-file-extensions.ts splits the non-image binary list into OS_VIEWER_BINARY_EXTENSIONS (archives, audio/video, Office documents, fonts, including .pdf) and COMPILED_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 new hasOsViewerOnlyFileExtension (OS_VIEWER minus .pdf) now drives the plain-click route.
  • Freshness guard for remote downloads — downloadAndOpenRemoteTerminalFile takes an optional isRequestCurrent, checked after the download and before openFilePath; both remote branches in openDetectedFilePath (the new plain-click route and the pre-existing Shift+Cmd/Ctrl route) pass requestId === latestOpenDetectedFilePathRequestId.
  • Tests — new routing test asserts a plain click on .exe/.jar/.dylib never 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.

Pullfrog  | View workflow run | Using DeepSeek Flash (free via Pullfrog for OSS) | 𝕏

@registered2nd
registered2nd force-pushed the fix/open-unviewable-binary-links-with-default-app branch 5 times, most recently from ee420a1 to 51676d8 Compare October 17, 2026 07:46
@registered2nd
registered2nd force-pushed the fix/open-unviewable-binary-links-with-default-app branch 4 times, most recently from d2f9324 to f830320 Compare October 26, 2026 04:46
@registered2nd
registered2nd force-pushed the fix/open-unviewable-binary-links-with-default-app branch 2 times, most recently from 64d0572 to dcb8ad5 Compare October 29, 2026 04:46
@greptile-apps

greptile-apps Bot commented Oct 29, 2026 •

Copy link
Copy Markdown

RetriggerView in GreptileConfidence Score: 3/5

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

Findings

  1. P1 Remote open failures disappear ▶
  2. P1 Granted binaries remain undisplayable ▶

Summary

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

  • Local viewer-only files fall back to the editor when the OS cannot open them.
  • SSH and paired-runtime files use the existing download-and-open flow with stale-request suppression.
  • Two remote cases remain incomplete: failed OS opening after download is silently treated as success, and grant-backed paired-runtime binaries still reach an undisplayable editor tab.

Diagram

%%{init: {'theme': 'neutral'}}%%
flowchart TD
  A[Plain file-link click] --> B{Viewer-only extension?}
  B -- No --> E[Open in Orca editor/viewer]
  B -- Yes --> C{Client OS can access path?}
  C -- Yes --> D[Open local path with OS app]
  D -- Failed --> E
  C -- No --> F{Grant-backed file?}
  F -- Yes --> G[Current behavior: open in editor]
  F -- No --> H[Download remote file]
  H --> I[Open downloaded copy with OS app]
  I -- Failed result currently discarded --> J[No editor fallback or notification]
Loading

Reviews (1) · Last reviewed commit: "fix(terminal): adapt the OS-viewer route..." · Reviewed by Greptile

Comment on lines +21 to +22
await downloadAndOpenRemoteTerminalFile(fileContext, filePath, isRequestCurrent)
return true

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 &&

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

@registered2nd
registered2nd force-pushed the fix/open-unviewable-binary-links-with-default-app branch from dcb8ad5 to a22898f Compare November 5, 2026 00:52
@registered2nd
registered2nd force-pushed the fix/open-unviewable-binary-links-with-default-app branch 3 times, most recently from 1566891 to 12e7f39 Compare November 9, 2026 01:04
…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.
registered2nd and others added 5 commits November 10, 2026 14:40
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.
@AmoabaKelvin

Copy link
Copy Markdown
Collaborator

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.

@AmoabaKelvin

Copy link
Copy Markdown
Collaborator

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.

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Bug]: A plain click on a terminal link to a video, archive or Office file opens a "Binary file — cannot display" tab

2 participants