stablyai/orca · error · Error

${result.error}

Error message

${result.error}

What it means

The worktree.resolvePrBase RPC succeeded at the transport level (response.ok === true) but the result body is { error: string }, the runtime's soft-error convention for provider-level failures. As the source comment notes, the runtime returns this payload 'rather than an RPC error for provider failures.' This means the host reached GitHub but could not resolve a usable base branch for the PR.

Source

Thrown at mobile/src/tasks/composer-source-base-resolve.ts:42

}): Promise<GitHubPrStartPoint> {
  const { client, repoId, prNumber, headRefName, baseRefName, isCrossRepository } = args
  const response = await client.sendRequest(
    'worktree.resolvePrBase',
    {
      repo: `id:${repoId}`,
      prNumber,
      ...(headRefName ? { headRefName } : {}),
      ...(baseRefName ? { baseRefName } : {}),
      ...(isCrossRepository !== undefined ? { isCrossRepository } : {})
    },
    { timeoutMs: 30_000 }
  )
  if (!response.ok) {
    throw new Error(response.error.message)
  }
  const result = (response as RpcSuccess).result as GitHubPrStartPoint | { error: string }
  if ('error' in result) {
    throw new Error(result.error)
  }
  return result
}

// Resolves a GitLab MR's base via worktree.resolveMrBase.
export async function resolveComposerMrBase(args: {
  client: RpcClient
  repoId: string
  mrIid: number
  sourceBranch?: string
  targetBranch?: string
  isCrossRepository?: boolean
}): Promise<ComposerHostedBase> {
  const { client, repoId, mrIid, sourceBranch, targetBranch, isCrossRepository } = args
  const response = await client.sendRequest(
    'worktree.resolveMrBase',
    {
      repo: `id:${repoId}`,

View on GitHub (pinned to 1136503c6a)

Solutions

  1. Catch at the composer source-selection layer and show result.error verbatim — it carries the provider's reason (e.g. 'base branch not found').
  2. Offer a manual base-branch picker as a fallback when the soft error is non-recoverable.
  3. Re-fetch the PR's head/base ref names before retrying resolveComposerPrBase so isCrossRepository and refs are current.
  4. If the error mentions permissions, direct the user to re-authorize GitHub on the desktop host.

Example fix

// before
const result = (response as RpcSuccess).result as GitHubPrStartPoint | { error: string }
if ('error' in result) {
  throw new Error(result.error)
}

// after — distinguish soft provider error from success so the UI can offer manual base selection
const result = (response as RpcSuccess).result as GitHubPrStartPoint | { error: string }
if ('error' in result) {
  throw new ComposerBaseResolveError(result.error, { retryable: true })
}
Defensive patterns

Strategy: try-catch

Validate before calling

// Re-fetch current PR ref names before resolving to avoid stale-head/base
const pr = await client.sendRequest('github.workItem', { repo: `id:${repoId}`, number: prNumber })
if (pr.ok && pr.result && !(pr.result as any).error) {
  // ref names are fresh
}

Type guard

function isGitHubPrStartPoint(r: unknown): r is GitHubPrStartPoint {
  return !!r && typeof r === 'object' && 'baseBranch' in r && !('error' in r)
}

Try / catch

try {
  const base = await resolveComposerPrBase({ client, repoId, prNumber, headRefName, baseRefName })
} catch (e) {
  // Soft provider error — offer manual base selection
  openManualBaseBranchPicker()
}

Prevention

When it happens

Trigger: The PR was deleted or closed and its refs are gone; the PR is a fork and headRefName/baseRefName are stale or omitted; cross-repository metadata (isCrossRepository) is wrong; GitHub returned the PR but the base branch no longer exists in the repo.

Common situations: User selects a linked PR whose base branch was force-pushed away; a cross-repo fork PR whose parent was renamed; the host's cached PR data is stale relative to upstream; maintainer disabled fork access (maintainerCanModify revoked).

Related errors


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