{"record":{"id":"6347923762e5a66f","repo":"stablyai/orca","slug":"response-error-message-634792","errorCode":null,"errorMessage":"response.error.message","messagePattern":"response\\.error\\.message","errorType":"exception","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"mobile/src/tasks/smart-source-paste-intent.ts","lineNumber":137,"sourceCode":"        resolved = null\n      }\n      cache.set(repo.id, resolved ?? null)\n    }\n    if (slugsEqual(resolved ?? null, slug)) {\n      return repo\n    }\n  }\n  return null\n}\n\nexport async function lookupGitHubItemByNumber(\n  client: RpcClient,\n  repoId: string,\n  number: number\n): Promise<GitHubWorkItem | null> {\n  const response = await client.sendRequest('github.workItem', { repo: `id:${repoId}`, number })\n  if (!response.ok) {\n    throw new Error(response.error.message)\n  }\n  const item = (response as RpcSuccess).result as GitHubWorkItem | null\n  return item ? { ...item, repoId } : null\n}\n\nexport async function lookupGitHubItemByOwnerRepo(\n  client: RpcClient,\n  repoId: string,\n  slug: RepoSlug,\n  number: number,\n  type: 'issue' | 'pr'\n): Promise<GitHubWorkItem | null> {\n  const response = await client.sendRequest('github.workItemByOwnerRepo', {\n    repo: `id:${repoId}`,\n    owner: slug.owner,\n    ownerRepo: slug.repo,\n    ...(slug.host ? { host: slug.host } : {}),\n    number,","sourceCodeStart":119,"sourceCodeEnd":155,"githubUrl":"https://github.com/stablyai/orca/blob/1136503c6a231a16dce8f921f6fadb63d181e8db/mobile/src/tasks/smart-source-paste-intent.ts#L119-L155","documentation":"The github.workItem RPC returned an RpcFailure (response.ok === false) when looking up a single GitHub issue or PR by repo-scoped number. The call passes { repo: 'id:<repoId>', number } and expects a GitHubWorkItem or null on success. A failure means the host could not reach GitHub or the repo integration is misconfigured.","triggerScenarios":"GitHub integration not configured for the repo on the host; the repo's GitHub token expired or was revoked; the host returned 'method_not_found' (older runtime without github.workItem); a transport-level failure mid-call.","commonSituations":"User pastes a #123 number into the smart source picker for a repo whose GitHub remote isn't linked on the host; host's GitHub OAuth token scope was reduced; mixed mobile/desktop versions; relay disconnect during lookup.","solutions":["Check response.error.code: 'method_not_found' → degrade to the search-based path; 'unauthorized' → re-pair.","Catch and return null (item not resolvable) so the paste flow falls back to a search.","Verify the repo has a GitHub upstream configured via repo metadata before calling.","Retry once after reconnect for transient transport errors."],"exampleFix":"// before\nif (!response.ok) {\n  throw new Error(response.error.message)\n}\n\n// after — degrade to null so the picker falls back to search\nif (!response.ok) {\n  if (response.error.code === 'method_not_found' || response.error.code === 'not_found') {\n    return null\n  }\n  throw new Error(response.error.message)\n}","handlingStrategy":"fallback","validationCode":"// Check GitHub is configured before lookup\nconst hasGithub = await client.sendRequest('github.repoSlug', { repo: `id:${repoId}` })\nif (!hasGithub.ok && hasGithub.error.code === 'method_not_found') {\n  return null // GitHub not available\n}","typeGuard":"function isRpcFailure(r: RpcResponse): r is RpcFailure {\n  return !r.ok\n}","tryCatchPattern":"try {\n  const item = await lookupGitHubItemByNumber(client, repoId, number)\n} catch (e) {\n  // Fall back to search\n  return null\n}","preventionTips":["Degrade to null (not-found) so the paste flow falls back to a search.","Check for method_not_found and not_found codes specifically.","Verify the repo has a GitHub upstream before lookup."],"tags":["rpc","github","smart-source","mobile","network"],"backgroundTag":null,"analyzedSha":"1136503c6a231a16dce8f921f6fadb63d181e8db","analyzedAt":"2026-08-12T23:15:58.167Z","schemaVersion":2},"datasetVersion":"2026-08-12T23:17:12.415Z"}