{"record":{"id":"c928bb0f3544345b","repo":"stablyai/orca","slug":"remote-remote-is-not-configured","errorCode":null,"errorMessage":"Remote \"${remote}\" is not configured.","messagePattern":"Remote \"(.+?)\" is not configured\\.","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"src/main/git/review-head-remote-identity.ts","lineNumber":23,"sourceCode":"  cwd: string\n  wslDistro?: string\n}\n\n// Why: the durable review-head ref embeds the remote's identity, and a missing\n// remote must fail with an actionable message instead of a raw fetch error.\nexport async function getReviewHeadRemoteComponent(\n  remote: string,\n  localGitExecOptions: LocalGitExecOptions\n): Promise<string> {\n  let remoteUrl: string\n  try {\n    const { stdout } = await gitExecFileAsync(['remote', 'get-url', remote], localGitExecOptions)\n    remoteUrl = stdout.trim()\n  } catch {\n    remoteUrl = ''\n  }\n  if (!remoteUrl) {\n    throw new Error(`Remote \"${remote}\" is not configured.`)\n  }\n  return reviewHeadRemoteRefComponent(remote, remoteUrl)\n}\n","sourceCodeStart":5,"sourceCodeEnd":27,"githubUrl":"https://github.com/stablyai/orca/blob/1136503c6a231a16dce8f921f6fadb63d181e8db/src/main/git/review-head-remote-identity.ts#L5-L27","documentation":"getReviewHeadRemoteComponent runs git remote get-url <remote> to capture the remote's identity for the durable review-head ref. If get-url exits non-zero OR returns an empty stdout (both collapsed to remoteUrl=''), the function throws — the review-head ref embeds the remote identity and cannot be built without it. The message names the missing remote so the caller can surface an actionable error rather than a raw fetch failure downstream.","triggerScenarios":"Calling getReviewHeadRemoteComponent(remote, { cwd, wslDistro }) where 'remote' is not in the repo's remote list (typo, removed remote, wrong remote name from a stale config), or git remote get-url failed for a non-remote reason and stdout was empty.","commonSituations":"A review-head ref tracking a remote that was renamed or deleted; a typo in the remote name passed by the caller; a worktree whose parent lost a remote during a reconfigure; passing a fork remote name that was never added; WSL distro mismatch where the get-url ran in a context without the remote configured.","solutions":["Verify the remote exists before calling: git remote should list it.","If the remote was renamed, pass the new name or rename it back.","Add the missing remote: git remote add <name> <url>.","If the remote is genuinely gone, recompute the review-head identity from the new canonical remote rather than retrying with the old name."],"exampleFix":"// before\nconst component = await getReviewHeadRemoteComponent(remoteName, { cwd: worktreePath })\n\n// after: verify the remote exists first\nconst { stdout } = await gitExecFileAsync(['remote'], { cwd: worktreePath })\nif (!stdout.split('\\n').map((l) => l.trim()).includes(remoteName)) {\n  throw new Error(`Cannot build review-head ref: remote '${remoteName}' is missing. Add or rename it.`)\n}\nconst component = await getReviewHeadRemoteComponent(remoteName, { cwd: worktreePath })","handlingStrategy":"validation","validationCode":"import { gitExecFileAsync } from './runner'\n\nasync function remoteExists(cwd: string, remote: string): Promise<boolean> {\n  const { stdout } = await gitExecFileAsync(['remote'], { cwd })\n  return stdout.split('\\n').map((l) => l.trim()).includes(remote)\n}\n\nif (!(await remoteExists(localGitExecOptions.cwd, remote))) {\n  throw new Error(`Cannot build review-head ref: remote '${remote}' is not configured.`)\n}","typeGuard":"function isRemoteNotConfigured(error: unknown): boolean {\n  return error instanceof Error && /^Remote \".+\" is not configured\\.$/.test(error.message)\n}","tryCatchPattern":"if (!(await remoteExists(cwd, remote))) await promptAddRemote(cwd, remote)\ntry { return await getReviewHeadRemoteComponent(remote, { cwd }) }\ncatch (error) { if (isRemoteNotConfigured(error)) { await promptAddRemote(cwd, remote); return await getReviewHeadRemoteComponent(remote, { cwd }) } throw error }","preventionTips":["Verify the remote exists in the remote list before building a review-head identity from it.","After a remote rename, recompute review-head identity from the new canonical name.","Do not pass stale remote names from old config into review-head construction."],"tags":["git","remote","review-head","validation"],"backgroundTag":null,"analyzedSha":"1136503c6a231a16dce8f921f6fadb63d181e8db","analyzedAt":"2026-08-12T23:15:58.167Z","schemaVersion":2},"datasetVersion":"2026-08-12T23:17:12.415Z"}