{"record":{"id":"33ca89eee1ed57b0","repo":"stablyai/orca","slug":"failed-to-load-commit-history","errorCode":null,"errorMessage":"Failed to load commit history","messagePattern":"Failed to load commit history","errorType":"exception","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"mobile/src/source-control/mobile-git-history.ts","lineNumber":68,"sourceCode":"    relativeTime: formatCommitTime(item.timestamp, nowMs)\n  }\n}\n\nexport function mapMobileCommitRows(result: GitHistoryResult, nowMs: number): MobileCommitRow[] {\n  return result.items.map((item) => toMobileCommitRow(item, nowMs))\n}\n\nexport async function fetchMobileGitHistory(\n  client: Pick<RpcClient, 'sendRequest'>,\n  worktreeId: string,\n  limit = 50\n): Promise<GitHistoryResult> {\n  const response = await client.sendRequest('git.history', {\n    worktree: `id:${worktreeId}`,\n    limit\n  })\n  if (!response.ok) {\n    throw new Error(response.error?.message || 'Failed to load commit history')\n  }\n  return (response as RpcSuccess).result as GitHistoryResult\n}\n","sourceCodeStart":50,"sourceCodeEnd":72,"githubUrl":"https://github.com/stablyai/orca/blob/1136503c6a231a16dce8f921f6fadb63d181e8db/mobile/src/source-control/mobile-git-history.ts#L50-L72","documentation":"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.","triggerScenarios":"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.","commonSituations":"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.","solutions":["Check the host-side git availability and that the worktree path still exists (`git -C <path> log`).","Confirm the `worktreeId` passed is current — reselect the worktree if it was recreated.","Read the propagated `error.message` (and code) to identify the specific host failure, then address that root cause.","Retry after the host finishes any in-progress clone/checkout."],"exampleFix":null,"handlingStrategy":"try-catch","validationCode":null,"typeGuard":null,"tryCatchPattern":"try {\n  const history = await fetchMobileGitHistory(client, worktreeId, 50)\n  setHistory(history)\n} catch (err) {\n  setHistoryError(err instanceof Error ? err.message : 'Failed to load commit history')\n}","preventionTips":["Confirm the worktree id is current before fetching history.","Surface the server's error.message — it carries the real git reason.","Retry once after reconnect; transient selector errors often clear."],"tags":["rpc","source-control","git","history"],"backgroundTag":null,"analyzedSha":"1136503c6a231a16dce8f921f6fadb63d181e8db","analyzedAt":"2026-08-12T23:15:58.167Z","schemaVersion":2},"datasetVersion":"2026-08-12T23:17:12.415Z"}