stablyai/orca · error

Repo has no configured origin remote.

Error message

Repo has no configured origin remote.

What it means

Thrown by resolveGitHubReviewHeadRemote when the caller requests issueSourcePreference 'origin' (so PR/review heads must come from the GitHub project hosted under the 'origin' remote) but `git remote` output contains no entry named 'origin'. The function deliberately hard-fails rather than guessing another remote, because listing issues/PRs against the wrong namespace would silently attribute a contributor's work to the upstream project.

Source

Thrown at src/main/github/review-head-remote.ts:26

// Why: explicit origin must match issue listing; otherwise hosting identity
// keeps contributor clones on the upstream project's PR namespace.
export async function resolveGitHubReviewHeadRemote(args: {
  repoPath: string
  issueSourcePreference?: IssueSourcePreference
  connectionId?: string | null
  localGitOptions?: { wslDistro?: string }
  gitExec: GitExec
}): Promise<string> {
  const { stdout } = await args.gitExec(['remote'])
  const remotes = stdout
    .split(/\r?\n/)
    .map((line) => line.trim())
    .filter(Boolean)
  if (args.issueSourcePreference === 'origin') {
    if (remotes.includes('origin')) {
      return 'origin'
    }
    throw new Error('Repo has no configured origin remote.')
  }
  // Why: identity probes cost a `remote get-url` (plus a possible gh auth
  // lookup) each; only multi-remote clones are ambiguous enough to need them.
  if (remotes.length > 1) {
    for (const remote of ['upstream', 'origin']) {
      if (!remotes.includes(remote)) {
        continue
      }
      const repository = await getGitHubApiRepositoryForRemote(
        args.repoPath,
        remote,
        args.connectionId ?? null,
        args.localGitOptions ?? {}
      )
      if (repository) {
        return remote
      }
    }

View on GitHub (pinned to 1136503c6a)

Solutions

  1. Add an origin remote pointing at your GitHub fork: `git remote add origin https://github.com/<you>/<repo>.git`
  2. If your fork lives under a different remote name, either rename it to origin (`git remote rename <name> origin`) or change issueSourcePreference away from 'origin' so the resolver can probe upstream/origin by GitHub identity.
  3. Run `git remote -v` to confirm which remotes exist and that origin is spelled exactly 'origin'.

Example fix

// before
resolveGitHubReviewHeadRemote({ repoPath, issueSourcePreference: 'origin', gitExec })
// after — verify origin exists, or fall back to auto-resolution
const remotes = (await gitExec(['remote'])).stdout.split(/\r?\n/).filter(Boolean)
resolveGitHubReviewHeadRemote({
  repoPath,
  issueSourcePreference: remotes.includes('origin') ? 'origin' : 'auto',
  gitExec
})
Defensive patterns

Strategy: validation

Validate before calling

const remotes = (await gitExec(['remote'])).stdout.split(/\r?\n/).map(l => l.trim()).filter(Boolean)
if (issueSourcePreference === 'origin' && !remotes.includes('origin')) {
  throw new Error(`Cannot use origin preference: remotes are [${remotes.join(', ')}]`)
}

Type guard

function hasOriginRemote(remotes: string[]): boolean {
  return remotes.includes('origin')
}

Try / catch

try {
  return await resolveGitHubReviewHeadRemote({ repoPath, issueSourcePreference, gitExec })
} catch (error) {
  if (error instanceof Error && error.message === 'Repo has no configured origin remote.') {
    // fall back to auto-resolution or prompt user to add origin
    return await resolveGitHubReviewHeadRemote({ repoPath, issueSourcePreference: 'auto', gitExec })
  }
  throw error
}

Prevention

When it happens

Trigger: Calling resolveGitHubReviewHeadRemote with issueSourcePreference === 'origin' on a clone whose only remote is 'upstream', a personally-named remote, or where `git remote` returns empty. Also hit when a fork-only clone (no origin added after `git clone <upstream>`) is configured to prefer origin.

Common situations: Fork-and-upstream workflows where the user cloned the upstream repo and added their fork under a custom name; CI checkouts that drop the origin remote; repos migrated/imported where the default remote was renamed; setting issueSourcePreference='origin' globally then opening a repo that lacks origin.

Related errors


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