stablyai/orca · error · Error

Unable to open diff

Error message

Unable to open diff

What it means

Thrown by `openFile` when neither `files.openDiff` nor its `files.open` fallback produces an ok response. The fallback to `files.open` only runs when `files.openDiff` failed with a mobile-git-unavailable code (old host without diff support); for any other openDiff failure, or when the fallback itself fails, this error is thrown and shown via `setActionError`.

Source

Thrown at mobile/src/source-control/use-mobile-source-control-openers.ts:128

        // Snapshot the active tab now, at tap time, before the openDiff RPC —
        // the session uses it to avoid stealing focus if the user switches tabs
        // during the RPC window.
        onFileOpenStart?.()
        let response = await client.sendRequest('files.openDiff', {
          worktree: `id:${worktreeId}`,
          relativePath: entry.path,
          staged: entry.area === 'staged'
        })
        let openedTabMode: 'diff' | 'edit' = 'diff'
        if (!response.ok && isMobileGitUnavailable(response.error?.code, response.error?.message)) {
          response = await client.sendRequest('files.open', {
            worktree: `id:${worktreeId}`,
            relativePath: entry.path
          })
          openedTabMode = 'edit'
        }
        if (!response.ok) {
          throw new Error(response.error?.message || 'Unable to open diff')
        }
        if (!mountedRef.current) {
          return
        }
        const revealResult = await revealMobileSourceControlSessionDiff({
          client,
          worktreeId,
          relativePath: entry.path,
          tabMode: openedTabMode,
          staged: entry.area === 'staged',
          onOpenedFileDiff,
          isCurrent: () => mountedRef.current && openingPathRef.current === entry.path
        })
        if (revealResult === 'cancelled') {
          return
        }
        if (revealResult === 'timeout') {
          throw new Error("The file opened, but its tab isn't ready yet. Try again.")

View on GitHub (pinned to 1136503c6a)

Solutions

  1. Refresh source-control status and retry — the entry may have stale path info.
  2. Confirm the file exists and is readable on the host.
  3. Update the desktop host so `files.openDiff` is supported (removing the need for the fallback).
  4. Open the file directly in an external editor as a workaround.
Defensive patterns

Strategy: try-catch

Try / catch

// openFile already wraps this in try/catch and calls setActionError;
// callers should offer a Retry and refresh status before re-tapping.
try {
  await openFile(entry)
} catch {
  await loadStatus({ force: true }) // refresh path info
}

Prevention

When it happens

Trigger: Tapping a changed file to open its diff where `files.openDiff` fails with a non-git-unavailable error, OR the host is git-unavailable and the `files.open` fallback also fails — e.g. the file no longer exists on disk, permission denied, or the worktree path is invalid.

Common situations: File was deleted/moved between status load and tap; permission error reading the file on an SSH host; old desktop build where both openDiff is unsupported and open fails for another reason; large file the host refuses to open.

Related errors


AI-assisted analysis of stablyai/orca@1136503c6a (2026-08-12). Data as JSON: /api/errors/f486238da9160803. Report an issue: GitHub.