stablyai/orca · info · Error

Binary branch diff preview unavailable on mobile

Error message

Binary branch diff preview unavailable on mobile

What it means

Thrown by `openBranchDiff` when `git.branchDiff` succeeds but the result is not a text diff — `result.kind !== 'text'` (i.e. `{ kind: 'binary' }`). Mobile cannot render a binary file's diff inline, so rather than show a blank/broken preview it throws this informative message. This is an expected capability boundary, not a crash.

Source

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

      setBranchDiffPreview({ kind: 'loading', entry })
      try {
        const response = await client.sendRequest('git.branchDiff', {
          worktree: `id:${worktreeId}`,
          filePath: entry.path,
          ...(entry.oldPath ? { oldPath: entry.oldPath } : {}),
          compare: {
            baseRef: summary.baseRef,
            ...(summary.baseOid ? { baseOid: summary.baseOid } : {}),
            headOid: summary.headOid,
            mergeBase: summary.mergeBase
          }
        })
        if (!response.ok) {
          throw new Error(response.error?.message || 'Unable to load committed diff')
        }
        const result = (response as RpcSuccess).result as GitDiffTextResult | { kind: 'binary' }
        if (result.kind !== 'text') {
          throw new Error('Binary branch diff preview unavailable on mobile')
        }
        const diff = buildMobileDiffLines(result.originalContent, result.modifiedContent)
        const syntaxLanguage = resolveMobileSyntaxLanguage(entry.path)
        if (!mountedRef.current) {
          return
        }
        setBranchDiffPreview({
          kind: 'ready',
          entry,
          summary,
          lines: highlightMobileDiffLines(diff.lines, syntaxLanguage),
          truncated: diff.truncated
        })
        triggerSelection()
      } catch (err) {
        if (!mountedRef.current) {
          return
        }

View on GitHub (pinned to 1136503c6a)

Solutions

  1. Open the binary file in its native viewer/editor instead of the inline diff preview.
  2. On desktop, view the diff there where binary rendering is supported.
  3. If the file is actually text but misdetected as binary, add a gitattributes `diff`/`text` hint and retry.
Defensive patterns

Strategy: type-guard

Type guard

function isTextBranchDiff(result: unknown): result is GitDiffTextResult {
  return !!result && typeof result === 'object' && (result as { kind?: string }).kind === 'text'
}

Try / catch

// This is an expected capability limit — degrade gracefully, don't retry.
if (result.kind !== 'text') {
  setBranchDiffPreview({ kind: 'error', entry, message: 'Binary branch diff preview unavailable on mobile' })
  return
}

Prevention

When it happens

Trigger: Tapping a committed change for a binary file (image, compiled asset, PDF, etc.) in the branch-diff preview; the host correctly returns `{ kind: 'binary' }` and mobile declines to render it.

Common situations: Reviewing commits that touch images, fonts, build artifacts, or any non-text file; a file that was detected as binary by git's heuristics even though it's technically text.

Related errors


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