{"record":{"id":"f96d701afefdd367","repo":"stablyai/orca","slug":"github-work-items-require-a-github-remote-for-ssh","errorCode":null,"errorMessage":"GitHub work items require a GitHub remote for SSH repositories","messagePattern":"GitHub work items require a GitHub remote for SSH repositories","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"src/main/github/client.ts","lineNumber":1198,"sourceCode":"}\n\n// Why: shared shape so listWorkItems can lift per-side errors (#1076 silent wrongness) into the IPC envelope — a swallowed side reads as end-of-data to pagination (#11485).\ntype PartialWorkItemsResult = {\n  items: MainWorkItem[]\n  issuesError?: ClassifiedError\n  prsError?: ClassifiedError\n}\n\nfunction assertSshRepoHasResolvedGitHubSource(args: {\n  connectionId?: string | null\n  issueOwnerRepo: OwnerRepo | null\n  prOwnerRepo: OwnerRepo | null\n}): void {\n  if (!args.connectionId || args.issueOwnerRepo || args.prOwnerRepo) {\n    return\n  }\n  // Why: SSH repo paths are remote-only, so without a resolved owner/repo gh would query local state.\n  throw new Error(GITHUB_WORK_ITEMS_SSH_REMOTE_REQUIRED_MESSAGE)\n}\n\ntype ResolvedPrWorkItemSource = {\n  source: OwnerRepo | null\n  originCandidate: OwnerRepo | null\n  upstreamCandidate: OwnerRepo | null\n}\n\nasync function resolvePrWorkItemSource(\n  repoPath: string,\n  preference: IssueSourcePreference | undefined,\n  connectionId?: string | null,\n  localGitOptions: LocalGitExecOptions = {}\n): Promise<ResolvedPrWorkItemSource> {\n  const [originCandidate, upstreamCandidate] = await Promise.all([\n    getOriginGitHubApiRepository(repoPath, connectionId, localGitOptions),\n    getGitHubApiRepositoryForRemote(repoPath, 'upstream', connectionId, localGitOptions)\n  ])","sourceCodeStart":1180,"sourceCodeEnd":1216,"githubUrl":"https://github.com/stablyai/orca/blob/1136503c6a231a16dce8f921f6fadb63d181e8db/src/main/github/client.ts#L1180-L1216","documentation":"Thrown by assertSshRepoHasResolvedGitHubSource when a repository is reached over an SSH connection (connectionId set) but neither issueOwnerRepo nor prOwnerRepo could be resolved to an owner/repo pair. SSH repo paths are remote-only, so without a resolved owner/repo the gh CLI would silently fall back to querying local git state and return wrong results. The constant GITHUB_WORK_ITEMS_SSH_REMOTE_REQUIRED_MESSAGE is reused so callers can pattern-match it.","triggerScenarios":"SSH target whose remote URL is not a GitHub URL (e.g. a private Gerrit or bare ssh URL); the GitHub remote was renamed or transferred and the cached owner/repo is stale; remote URL parsing failed for an scp-style URL with an unusual port or path; the SSH relay could not enumerate remotes.","commonSituations":"SSHing into a box whose repo has no GitHub origin; a fork was renamed upstream; ssh-host git remote uses git@custom-host:alias that the parser can't map to owner/repo; relay connection dropped before remote enumeration completed.","solutions":["On the SSH host, run `git remote -v` and confirm an `origin` (or upstream) URL of the form `git@github.com:owner/repo.git` or `https://github.com/owner/repo`.","If the remote is not GitHub, GitHub work items (PRs/issues) are not available for this target — that is expected.","If the remote is correct but stale, re-fetch and let Orca re-resolve; for a renamed repo, update the remote URL with `git remote set-url`.","Reconnect to the SSH target so the relay re-enumerates remotes."],"exampleFix":null,"handlingStrategy":"validation","validationCode":"// Pre-resolve owner/repo and fail fast with a clearer message.\nasync function resolveGitHubOwnerRepo(repoPath: string): Promise<OwnerRepo | null> {\n  const url = await getOriginUrl(repoPath)\n  return parseGitHubOwnerRepo(url) // returns null for non-GitHub URLs\n}","typeGuard":"function hasResolvedOwnerRepo(o: unknown): o is { owner: string; repo: string } {\n  return !!o && typeof o === 'object' &&\n    typeof (o as any).owner === 'string' && typeof (o as any).repo === 'string'\n}","tryCatchPattern":"try {\n  await loadGitHubWorkItems(repoPath, connectionId)\n} catch (err) {\n  if ((err as Error).message === GITHUB_WORK_ITEMS_SSH_REMOTE_REQUIRED_MESSAGE) {\n    showNonGitHubTargetNotice()\n  } else throw err\n}","preventionTips":["Confirm `git remote -v` shows a GitHub origin before enabling GitHub work items.","Reconnect to SSH targets after renaming a fork's remote URL.","Cache resolved owner/repo and invalidate on remote-url change."],"tags":["github","ssh","remote","owner-repo","configuration"],"backgroundTag":null,"analyzedSha":"1136503c6a231a16dce8f921f6fadb63d181e8db","analyzedAt":"2026-08-12T23:15:58.167Z","schemaVersion":2},"datasetVersion":"2026-08-12T23:17:12.415Z"}