stablyai/orca · error · Error

Unable to load committed diff

Error message

Unable to load committed diff

What it means

Thrown by `openBranchDiff` (the committed/branch diff preview) when the `git.branchDiff` RPC returns ok:false. The server error message is preferred; the literal is a fallback. The catch at 273 reuses the literal for non-Error throws and sets the branch-diff preview to an error state.

Source

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

          setOpeningBranchPath(null)
        }
        return
      }
      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()

View on GitHub (pinned to 1136503c6a)

Solutions

  1. Reload branch compare (the Changes screen refresh) to get fresh baseRef/OIDs, then reopen the diff.
  2. Read the propagated error message for the host-side git reason.
  3. If the repo is shallow, unshallow it so the merge base resolves.
  4. Update the desktop host to match the mobile `git.branchDiff` compare contract.
Defensive patterns

Strategy: try-catch

Try / catch

// openBranchDiff already catches and sets branchDiffPreview to error;
// reload branch compare to refresh OIDs, then reopen.
try {
  await openBranchDiff(entry)
} catch {
  await loadBranchCompare({ preserveReadyOnFailure: true })
}

Prevention

When it happens

Trigger: Tapping a committed change to preview its branch diff where `git.branchDiff` fails — invalid/expired baseRef/baseOid/headOid/mergeBase in the compare block, git internal error computing the diff, the path or oldPath no longer resolves, or a size limit exceeded.

Common situations: The branch has been force-pushed so the stored OIDs no longer exist; a shallow clone cannot resolve the merge base; the diff is enormous and the host aborts; mixed versions where the `compare` param shape differs.

Related errors


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