{"record":{"id":"15c9c5d3a05826f2","repo":"stablyai/orca","slug":"rpc-error-message-15c9c5","errorCode":null,"errorMessage":"${RPC error message}","messagePattern":"\\$\\{RPC error message\\}","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"mobile/src/session/mobile-new-tab-agent-loader.ts","lineNumber":30,"sourceCode":"  id: string\n  connectionId?: string | null\n}\n\nexport async function loadMobileNewTabAgentOptions(args: {\n  client: RpcClient\n  worktreeId: string\n}): Promise<MobileNewTabAgentOption[]> {\n  const { client, worktreeId } = args\n  // Why: the floating workspace runs on the paired host, so it has no repo connection to resolve.\n  const detectedAgentsRequest = isFloatingWorkspaceWorktreeId(worktreeId)\n    ? client.sendRequest('preflight.detectAgents')\n    : loadWorkspaceDetectedAgents(client, worktreeId)\n  const [settingsResponse, detectedResponse] = await Promise.all([\n    client.sendRequest('settings.get'),\n    detectedAgentsRequest\n  ])\n  if (!settingsResponse.ok) {\n    throw new Error((settingsResponse as RpcFailure).error.message)\n  }\n  if (!detectedResponse.ok) {\n    throw new Error((detectedResponse as RpcFailure).error.message)\n  }\n  const settings = (\n    (settingsResponse as RpcSuccess).result as {\n      settings?: MobileNewTabAgentSettings\n    }\n  ).settings\n  return buildMobileNewTabAgentOptions(\n    settings,\n    (detectedResponse as RpcSuccess).result as unknown[]\n  )\n}\n\nasync function loadWorkspaceDetectedAgents(client: RpcClient, worktreeId: string) {\n  const repoResponse = await client.sendRequest('repo.list')\n  if (!repoResponse.ok) {","sourceCodeStart":12,"sourceCodeEnd":48,"githubUrl":"https://github.com/stablyai/orca/blob/1136503c6a231a16dce8f921f6fadb63d181e8db/mobile/src/session/mobile-new-tab-agent-loader.ts#L12-L48","documentation":"Re-thrown host error when the paired desktop returns an RPC failure (ok:false) for `settings.get`, the first leg of the mobile new-tab agent loader. The loader fans out `settings.get` and an agent-detection request concurrently via Promise.all and propagates the host's `error.message` verbatim so the new-tab screen can surface it. It is a passthrough of a host-side or transport failure, not a client bug.","triggerScenarios":"Opening the mobile new-tab sheet while the host rejects `settings.get` (settings store read error, permission failure, host shutting down); or the relay/direct socket drops mid-Promise.all and the host returns an error envelope.","commonSituations":"Host just restarted or is mid-shutdown when the user taps new tab; relay->direct cutover rejects the in-flight one-shot; host settings file corrupt/unreadable; mixed client/host versions where the desktop does not yet implement `settings.get`.","solutions":["Reconnect to the host (usually transient).","Check desktop host logs for the settings.get error code/message.","Verify client/host version compatibility (remote wire compat).","Inspect the host settings store if persistent."],"exampleFix":"// before\nconst [settingsResponse, detectedResponse] = await Promise.all([...])\nif (!settingsResponse.ok) {\n  throw new Error((settingsResponse as RpcFailure).error.message)\n}\n// after - preserve the host error code so the screen can branch\nif (!settingsResponse.ok) {\n  const f = settingsResponse as RpcFailure\n  throw new MobileRpcError('settings.get', f.error.code, f.error.message)\n}","handlingStrategy":"try-catch","validationCode":"if (connState !== 'connected' || !client) return // defer until connected","typeGuard":"function isRpcFailure(r: RpcResponse): r is RpcFailure {\n  return r.ok === false\n}","tryCatchPattern":"try {\n  const options = await loadMobileNewTabAgentOptions({ client, worktreeId })\n} catch (err) {\n  setNewTabError(err instanceof Error ? err.message : 'Could not load agents')\n}","preventionTips":["Gate the new-tab loader on connState==='connected'.","Offer a retry control on RPC failure.","Keep client and host on compatible wire versions."],"tags":["rpc","settings","mobile","new-tab"],"backgroundTag":null,"analyzedSha":"1136503c6a231a16dce8f921f6fadb63d181e8db","analyzedAt":"2026-08-12T23:15:58.167Z","schemaVersion":2},"datasetVersion":"2026-08-12T23:17:12.415Z"}