{"record":{"id":"65d22e79991c8ff9","repo":"stablyai/orca","slug":"unable-to-load-agent-sessions-65d22e","errorCode":null,"errorMessage":"Unable to load agent sessions","messagePattern":"Unable to load agent sessions","errorType":"exception","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"mobile/src/session/use-mobile-diff-review-send-actions.ts","lineNumber":136,"sourceCode":"        throw new Error('Created terminal response was invalid')\n      }\n      await sendPromptToTerminal(created.terminal, comments)\n    },\n    [client, connState, sendPromptToTerminal, worktreeId]\n  )\n\n  const openSendSheet = useCallback(async () => {\n    if (!client || connState !== 'connected') {\n      setActionError('Waiting for desktop...')\n      return\n    }\n    setSendSheet({ kind: 'loading' })\n    try {\n      const response = await client.sendRequest('session.tabs.list', {\n        worktree: `id:${worktreeId}`\n      })\n      if (!response.ok) {\n        throw new Error(response.error?.message || 'Unable to load agent sessions')\n      }\n      setSendSheet({ kind: 'ready', terminals: readMobileReviewTerminalTabs(response.result) })\n    } catch (err) {\n      setSendSheet({\n        kind: 'error',\n        message: err instanceof Error ? err.message : 'Unable to load agent sessions',\n        terminals: []\n      })\n    }\n  }, [client, connState, setActionError, setSendSheet, worktreeId])\n\n  return {\n    clearSentNotes,\n    copyNotes,\n    createTerminalAndSend,\n    openSendSheet,\n    sendPromptToTerminal\n  }","sourceCodeStart":118,"sourceCodeEnd":154,"githubUrl":"https://github.com/stablyai/orca/blob/1136503c6a231a16dce8f921f6fadb63d181e8db/mobile/src/session/use-mobile-diff-review-send-actions.ts#L118-L154","documentation":"Thrown (then caught locally into a sheet error state) when `session.tabs.list` (populate the send-sheet with available agent terminals) returns ok:false. The host's error.message is preferred; the literal is the fallback. The catch puts the sheet into {kind:'error'}.","triggerScenarios":"Host cannot list session tabs - session gone, transport failure, or host shutting down.","commonSituations":"Relay drop when opening the send sheet; host restart; version skew on session.tabs.list params.","solutions":["Reopen the send sheet after reconnecting.","Verify the session/worktree exists.","Check host logs.","Update versions."],"exampleFix":"// before\nif (!response.ok) {\n  throw new Error(response.error?.message || 'Unable to load agent sessions')\n}\n// after\nif (!response.ok) {\n  throw new RpcMethodError('session.tabs.list', response.error)\n}","handlingStrategy":"try-catch","validationCode":"if (!client || connState !== 'connected') {\n  setActionError('Waiting for desktop...')\n  return\n}","typeGuard":"function isRpcFailure(r: RpcResponse): r is RpcFailure {\n  return r.ok === false\n}","tryCatchPattern":"try {\n  await openSendSheet()\n} catch (err) {\n  setSendSheet({ kind: 'error', message: err instanceof Error ? err.message : 'Unable to load agent sessions', terminals: [] })\n}","preventionTips":["Open the send sheet only when connected.","Retry session.tabs.list on cutover.","Show a retry control in the error sheet state."],"tags":["rpc","session-tabs","send-notes","diff-review","mobile"],"backgroundTag":null,"analyzedSha":"1136503c6a231a16dce8f921f6fadb63d181e8db","analyzedAt":"2026-08-12T23:15:58.167Z","schemaVersion":2},"datasetVersion":"2026-08-12T23:17:12.415Z"}