{"record":{"id":"2e3b79d130f23e2d","repo":"different-ai/openwork","slug":"workspace-runtime-is-not-connected","errorCode":null,"errorMessage":"Workspace runtime is not connected.","messagePattern":"Workspace runtime is not connected\\.","errorType":"exception","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"apps/app/src/react-app/shell/session-route.tsx","lineNumber":2509,"sourceCode":"\n  const currentSessionGroupId = selectedSessionId\n    ? selectedWorkspaceGroupState?.assignments[selectedSessionId] ?? null\n    : null;\n\n  const handleMoveCurrentSessionToGroup = useCallback((groupId: string) => {\n    if (!selectedWorkspaceId || !selectedSessionId) return;\n    assignSessionToGroup(selectedWorkspaceId, selectedSessionId, groupId);\n  }, [assignSessionToGroup, selectedSessionId, selectedWorkspaceId]);\n\n  const sessionSearchFetcher = useMemo<SessionMessageFetcher | null>(() => {\n    if (!client) return null;\n    // Cap the transcript fetch to keep multi-workspace scans fast; matches in\n    // anything older than the most recent 400 messages are traded away for\n    // responsiveness.\n    return async (workspaceId: string, sessionId: string) => {\n      const workspace = workspaces.find((item) => item.id === workspaceId);\n      const endpoint = endpointForWorkspace(workspace);\n      if (!endpoint) throw new Error(\"Workspace runtime is not connected.\");\n      return getNativeSessionMessages(endpoint, sessionId, { limit: 400 });\n    };\n  }, [client, endpointForWorkspace, workspaces]);\n\n  const sessionSearchPaletteItem = useMemo<PaletteItem>(() => ({\n    id: \"session-search.open\",\n    title: \"Search session messages\",\n    detail: \"Deep search every session, including message content\",\n    meta: \"Cmd/Ctrl+Shift+F\",\n    searchText: \"search find sessions messages history transcript content\",\n    action: () => {\n      setCommandPaletteOpen(false);\n      setSessionSearchOpen(true);\n    },\n  }), []);\n\n  const sessionFindPaletteItem = useMemo<PaletteItem | null>(() => {\n    if (!selectedSessionId) return null;","sourceCodeStart":2491,"sourceCodeEnd":2527,"githubUrl":"https://github.com/different-ai/openwork/blob/2b7df46e8ae1517d64c896c7793d2d52ec845669/apps/app/src/react-app/shell/session-route.tsx#L2491-L2527","documentation":"The session-message fetcher for search resolves the workspace and its endpoint before calling getNativeSessionMessages(). If endpointForWorkspace returns null, the workspace runtime is not connected and fetching the transcript is impossible, so the callback throws this error. The 400-message limit above is a performance cap unrelated to the failure.","triggerScenarios":"Invoking the returned (workspaceId, sessionId) fetcher from session search when no endpoint exists: workspace disconnected, server stopped, or workspaceId not present in the workspaces list.","commonSituations":"Searching across many workspaces where some are disconnected; searching a recently removed workspace; server crashed mid-session so the endpoint map is stale; remote workspace offline.","solutions":["Reconnect the workspace runtime, then retry the session search","Remove or refresh the disconnected workspace from the workspace list so search skips it","Verify the workspaceId belongs to a connected workspace before searching its sessions"],"exampleFix":null,"handlingStrategy":"validation","validationCode":"const endpoint = endpointForWorkspace(workspaces.find((w) => w.id === workspaceId));\nif (!endpoint) {\n  notify(\"Connect this workspace to search its sessions.\");\n  return;\n}\nawait getNativeSessionMessages(endpoint, sessionId, { limit: 400 });","typeGuard":"const isConnectedWorkspace = (id: string): boolean =>\n  !!endpointForWorkspace(workspaces.find((w) => w.id === id));","tryCatchPattern":"try {\n  const messages = await fetchSessionMessages(workspaceId, sessionId);\n} catch (e) {\n  if (String(e.message).includes(\"not connected\")) {\n    excludeWorkspaceFromSearch(workspaceId);\n  }\n}","preventionTips":["Filter search sources to connected workspaces only","Prune workspaces from the search index when they disconnect","Reconnect stale endpoints before running cross-workspace scans"],"tags":["search","connection","workspace","server"],"backgroundTag":"server-not-connected","analyzedSha":"2b7df46e8ae1517d64c896c7793d2d52ec845669","analyzedAt":"2026-09-01T07:59:23.713Z","contentChangedAt":null,"schemaVersion":2},"datasetVersion":"2026-09-08T10:18:20.063Z"}