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
- Open the binary file in its native viewer/editor instead of the inline diff preview.
- On desktop, view the diff there where binary rendering is supported.
- 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
- Guard the result kind before rendering so binary files show a clean message instead of crashing.
- Offer to open binary files in their native viewer.
- Add gitattributes text hints for files git misclassifies as binary.
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
- Source control action failed
- Unable to open diff
- The file opened, but its tab isn't ready yet. Try again.
- Unable to load committed diff
- Unable to read markdown
AI-assisted analysis of stablyai/orca@1136503c6a (2026-08-12).
Data as JSON: /api/errors/c177f328ee29a675.
Report an issue: GitHub.