{"record":{"id":"7e8413aa69830f87","repo":"stablyai/orca","slug":"response-error-message-7e8413","errorCode":null,"errorMessage":"${response.error.message}","messagePattern":"\\$\\{response\\.error\\.message\\}","errorType":"exception","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"mobile/src/tasks/composer-source-base-resolve.ts","lineNumber":38,"sourceCode":"  prNumber: number\n  headRefName?: string\n  baseRefName?: string\n  isCrossRepository?: boolean\n}): Promise<GitHubPrStartPoint> {\n  const { client, repoId, prNumber, headRefName, baseRefName, isCrossRepository } = args\n  const response = await client.sendRequest(\n    'worktree.resolvePrBase',\n    {\n      repo: `id:${repoId}`,\n      prNumber,\n      ...(headRefName ? { headRefName } : {}),\n      ...(baseRefName ? { baseRefName } : {}),\n      ...(isCrossRepository !== undefined ? { isCrossRepository } : {})\n    },\n    { timeoutMs: 30_000 }\n  )\n  if (!response.ok) {\n    throw new Error(response.error.message)\n  }\n  const result = (response as RpcSuccess).result as GitHubPrStartPoint | { error: string }\n  if ('error' in result) {\n    throw new Error(result.error)\n  }\n  return result\n}\n\n// Resolves a GitLab MR's base via worktree.resolveMrBase.\nexport async function resolveComposerMrBase(args: {\n  client: RpcClient\n  repoId: string\n  mrIid: number\n  sourceBranch?: string\n  targetBranch?: string\n  isCrossRepository?: boolean\n}): Promise<ComposerHostedBase> {\n  const { client, repoId, mrIid, sourceBranch, targetBranch, isCrossRepository } = args","sourceCodeStart":20,"sourceCodeEnd":56,"githubUrl":"https://github.com/stablyai/orca/blob/1136503c6a231a16dce8f921f6fadb63d181e8db/mobile/src/tasks/composer-source-base-resolve.ts#L20-L56","documentation":"The worktree.resolvePrBase RPC returned an RpcFailure (response.ok === false), so the desktop runtime rejected the request at the transport/protocol layer. The error envelope is { code, message, data } per RpcFailure in transport/types.ts:31. This is distinct from a GitHub provider failure, which the runtime surfaces as a soft { error: string } inside a successful result (caught separately at line 42). Common codes seen in this codebase: 'method_not_found' (host predates the RPC), 'unauthorized' (pairing revoked), 'runtime_error' (host-side throw).","triggerScenarios":"Calling resolveComposerPrBase against a desktop runtime older than the worktree.resolvePrBase method; the paired host's GitHub integration is unauthenticated; the 30s timeoutMs budget lapses over a slow VPN; the WebSocket dropped mid-call and the replay was rejected.","commonSituations":"Mobile app upgraded ahead of the desktop app (method not yet shipped on host); pairing token revoked between connect and this call; host's GitHub PAT/OAuth token expired; relay or Tailscale route adding latency past the 30s ceiling.","solutions":["Inspect response.error.code before throwing: if 'method_not_found', surface 'Update Orca on your computer' rather than a raw provider error.","If response.error.code === 'unauthorized', trigger the re-pair flow (the rpc-client latches auth-failed after 3 retries).","Retry the call once after client.getState() returns 'connected' for transient 'runtime_error' codes.","Raise timeoutMs or pass budgetSpansConnect when the call runs right after a slow reconnect."],"exampleFix":"// before\nif (!response.ok) {\n  throw new Error(response.error.message)\n}\n\n// after\nif (!response.ok) {\n  if (response.error.code === 'method_not_found') {\n    throw new ComposerBaseUnsupportedError('Resolve PR base needs a newer desktop version')\n  }\n  throw new Error(response.error.message)\n}","handlingStrategy":"try-catch","validationCode":"// Check connection + capability before sending\nif (client.getState() !== 'connected') {\n  throw new Error('Not connected — cannot resolve PR base')\n}\n// Optionally probe method support once and cache (like findRepoMatchingSlugForPaste caches method_not_found)","typeGuard":"function isRpcFailure(r: RpcResponse): r is RpcFailure {\n  return !r.ok\n}\n\nfunction isSoftErrorResult(r: unknown): r is { error: string } {\n  return !!r && typeof r === 'object' && 'error' in r && typeof (r as any).error === 'string'\n}","tryCatchPattern":"try {\n  const base = await resolveComposerPrBase({ client, repoId, prNumber })\n} catch (e) {\n  if (e.message.includes('method_not_found')) {\n    showUpgradePrompt()\n  } else if (e.message.includes('unauthorized')) {\n    startRePair()\n  } else {\n    showError(e.message)\n  }\n}","preventionTips":["Cache method_not_found per host so you don't repeat an unsupported probe on every PR selection.","Check client.getState() === 'connected' before interactive calls to fail fast with a clear message.","Keep mobile and desktop versions in sync to avoid method_not_found on new RPCs."],"tags":["rpc","github","worktree","mobile","network","version-mismatch"],"backgroundTag":null,"analyzedSha":"1136503c6a231a16dce8f921f6fadb63d181e8db","analyzedAt":"2026-08-12T23:15:58.167Z","schemaVersion":2},"datasetVersion":"2026-08-12T23:17:12.415Z"}