stablyai/orca · error · Error

Failed to load commit history

Error message

Failed to load commit history

What it means

Thrown by `fetchMobileGitHistory` when the `git.history` RPC resolves ok:false. It prefers the server-supplied `error.message` and only falls back to the literal string when the message is absent. The function is a thin transport wrapper used to populate the mobile commit list.

Source

Thrown at mobile/src/source-control/mobile-git-history.ts:68

    relativeTime: formatCommitTime(item.timestamp, nowMs)
  }
}

export function mapMobileCommitRows(result: GitHistoryResult, nowMs: number): MobileCommitRow[] {
  return result.items.map((item) => toMobileCommitRow(item, nowMs))
}

export async function fetchMobileGitHistory(
  client: Pick<RpcClient, 'sendRequest'>,
  worktreeId: string,
  limit = 50
): Promise<GitHistoryResult> {
  const response = await client.sendRequest('git.history', {
    worktree: `id:${worktreeId}`,
    limit
  })
  if (!response.ok) {
    throw new Error(response.error?.message || 'Failed to load commit history')
  }
  return (response as RpcSuccess).result as GitHistoryResult
}

View on GitHub (pinned to 1136503c6a)

Solutions

  1. Check the host-side git availability and that the worktree path still exists (`git -C <path> log`).
  2. Confirm the `worktreeId` passed is current — reselect the worktree if it was recreated.
  3. Read the propagated `error.message` (and code) to identify the specific host failure, then address that root cause.
  4. Retry after the host finishes any in-progress clone/checkout.
Defensive patterns

Strategy: try-catch

Try / catch

try {
  const history = await fetchMobileGitHistory(client, worktreeId, 50)
  setHistory(history)
} catch (err) {
  setHistoryError(err instanceof Error ? err.message : 'Failed to load commit history')
}

Prevention

When it happens

Trigger: Calling `fetchMobileGitHistory(client, worktreeId, limit)` where `git.history` returns ok:false — e.g. invalid worktree selector, not a git repository, git binary missing/crashing on the host, or a permission error.

Common situations: Worktree id references a path the host can no longer resolve (deleted worktree, moved repo); git is not installed or not on PATH on the SSH host; the repository is mid-clone or locked; large-history repos hitting a host-side timeout.

Related errors


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