different-ai/openwork · error · Error
Workspace runtime is not connected.
Error message
Workspace runtime is not connected.
What it means
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.
Source
Thrown at apps/app/src/react-app/shell/session-route.tsx:2509
const currentSessionGroupId = selectedSessionId
? selectedWorkspaceGroupState?.assignments[selectedSessionId] ?? null
: null;
const handleMoveCurrentSessionToGroup = useCallback((groupId: string) => {
if (!selectedWorkspaceId || !selectedSessionId) return;
assignSessionToGroup(selectedWorkspaceId, selectedSessionId, groupId);
}, [assignSessionToGroup, selectedSessionId, selectedWorkspaceId]);
const sessionSearchFetcher = useMemo<SessionMessageFetcher | null>(() => {
if (!client) return null;
// Cap the transcript fetch to keep multi-workspace scans fast; matches in
// anything older than the most recent 400 messages are traded away for
// responsiveness.
return async (workspaceId: string, sessionId: string) => {
const workspace = workspaces.find((item) => item.id === workspaceId);
const endpoint = endpointForWorkspace(workspace);
if (!endpoint) throw new Error("Workspace runtime is not connected.");
return getNativeSessionMessages(endpoint, sessionId, { limit: 400 });
};
}, [client, endpointForWorkspace, workspaces]);
const sessionSearchPaletteItem = useMemo<PaletteItem>(() => ({
id: "session-search.open",
title: "Search session messages",
detail: "Deep search every session, including message content",
meta: "Cmd/Ctrl+Shift+F",
searchText: "search find sessions messages history transcript content",
action: () => {
setCommandPaletteOpen(false);
setSessionSearchOpen(true);
},
}), []);
const sessionFindPaletteItem = useMemo<PaletteItem | null>(() => {
if (!selectedSessionId) return null;View on GitHub (pinned to 2b7df46e8a)
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
Defensive patterns
Strategy: validation
Validate before calling
const endpoint = endpointForWorkspace(workspaces.find((w) => w.id === workspaceId));
if (!endpoint) {
notify("Connect this workspace to search its sessions.");
return;
}
await getNativeSessionMessages(endpoint, sessionId, { limit: 400 }); Type guard
const isConnectedWorkspace = (id: string): boolean => !!endpointForWorkspace(workspaces.find((w) => w.id === id));
Try / catch
try {
const messages = await fetchSessionMessages(workspaceId, sessionId);
} catch (e) {
if (String(e.message).includes("not connected")) {
excludeWorkspaceFromSearch(workspaceId);
}
} Prevention
- Filter search sources to connected workspaces only
- Prune workspaces from the search index when they disconnect
- Reconnect stale endpoints before running cross-workspace scans
When it happens
Trigger: 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.
Common situations: 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.
Related errors
- OpenWork server is unavailable. Reconnect the server before
- OpenWork server unavailable.
- app.error_connect_first
- app.error_connect_first
- OpenWork server has no workspace matching ${directory}.
AI-assisted analysis of different-ai/openwork@2b7df46e8a (2026-09-01).
Data as JSON: /api/errors/2e3b79d130f23e2d.
Report an issue: GitHub.