Skip to content

Remote runtime File Explorer open/retry can fall back to local fs:readFile #6440

Closed

Description

@Jinwoo-H

Summary

While validating PR #6436, I found a separate remote-runtime editor-open issue: after opening a file from a Remote Host / paired runtime File Explorer, the editor can show Unable to load file; clicking Retry repeats the same failure because the editor tab is routed through local fs:readFile instead of the paired runtime file RPC.

This is separate from the Download fix in #6436. The Download action completed successfully for the same file.

Repro Harness Used

  1. Launch the PR/dev app with isolated user data and verify identity.
  2. Start a headless Orca runtime server in a foreground PTY:
    ORCA_DEV_USER_DATA_PATH=/tmp/orca-remote-e2e/server-user-data \
      ./node_modules/.bin/electron . --serve --serve-json --serve-port 6775
  3. Pair that runtime into the desktop app with the emitted orca://pair?... URL.
  4. On the runtime server, register a disposable git repo containing:
    • README.md
    • large.bin (1,048,699 bytes)
  5. Set that repo's externalWorktreeVisibility to show, fetch the runtime repo/worktree into the desktop app, and select the runtime worktree.
  6. Open File Explorer for that runtime worktree.
  7. Click large.bin in File Explorer.
  8. Observe the editor tab error, then click Retry.

Actual Result

The editor tab shows:

Unable to load file
Error invoking remote method 'fs:readFile': Error: Access denied: path resolves outside allowed directories. If this blocks a legitimate workflow, please file a GitHub issue.

Clicking Retry repeats the same failure. No renderer console errors were emitted during the retry.

Expected Result

Opening a file from a runtime-owned File Explorer should load through the runtime file RPC path, or produce a runtime-aware unsupported/too-large/binary message. Retry should retry the same runtime-aware read, not local fs:readFile.

Notes From Investigation

The editor supports runtime-owned tabs via runtimeEnvironmentId, and readRuntimeFileContent uses runtime RPC when the active settings contain the runtime owner.

The File Explorer row activation path appears to open files without explicitly carrying the runtime owner:

  • src/renderer/src/components/right-sidebar/useFileExplorerHandlers.ts calls openFile({ filePath, relativePath, worktreeId, ... }) without runtimeEnvironmentId.
  • store.openFile can fall back to settings.activeRuntimeEnvironmentId, but that makes correctness depend on ambient global state rather than the selected file/worktree owner.

This may be state-dependent rather than universal, but a runtime-owned File Explorer row should preserve the runtime owner explicitly so editor load/retry cannot fall back to local filesystem reads.

Validation That Download Is Not Affected

For the same runtime file, the File Explorer context-menu Download action worked:

  • macOS native Save dialog opened for large.bin.
  • Saved file matched the runtime source exactly:
    • size: 1,048,699 bytes
    • SHA-256: 6eb96989e4bb95cf79889ee7e62cf3a3bf1b19152c7b9b9cf6ca9b03883459f0

So this issue is specifically about editor open/retry routing, not the download path.

Made with Orca 🐋

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    orca-remote-server

    Type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions