{"record":{"id":"982c77a4b9e4303e","repo":"different-ai/openwork","slug":"openwork-server-is-required-to-repair-agent-access","errorCode":null,"errorMessage":"OpenWork server is required to repair agent access to connected services.","messagePattern":"OpenWork server is required to repair agent access to connected services\\.","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"apps/app/src/react-app/domains/connections/store.ts","lineNumber":757,"sourceCode":"\n    if (conflictsWithOpenworkConnect(entry)) {\n      const error = t(\"mcp.name_reserved_openwork_connect\");\n      setStateField(\"mcpStatus\", error);\n      finishPerf(options.developerMode(), \"mcp.connect\", \"blocked\", startedAt, {\n        reason: \"openwork-connect-name-reserved\",\n      });\n      return { ok: false, error };\n    }\n\n    try {\n      mutateState((current) => ({ ...current, mcpStatus: null, mcpConnectingName: entry.name }));\n\n      if (entry.managedBy === \"openwork-connect\") {\n        if (slug !== CLOUD_MCP_SERVER_NAME) {\n          throw new Error(\"OpenWork Connect MCP metadata is invalid.\");\n        }\n        if (!canUseOpenworkServer || !openworkClient || !openworkWorkspaceId) {\n          throw new Error(\"OpenWork server is required to repair agent access to connected services.\");\n        }\n        const context = await resolveCloudMcpOperationContext(entry.url);\n        if (!context) {\n          throw new Error(\"Sign in to OpenWork Cloud and choose an organization first.\");\n        }\n        clearCloudMcpDisabledIntent(context);\n        const result = await runOpenworkCloudMcpReconciler({\n          mode: \"repair\",\n          client: openworkClient,\n          context: { ...context, trigger: \"desktop-explicit-connect\" },\n          mintToken: mintCloudControlMcpToken,\n          force: true,\n          refreshMarginMs: CLOUD_MCP_REFRESH_MARGIN_MS,\n        });\n        await refreshMcpServers();\n        if (result.health?.usable) {\n          setStateField(\"mcpStatus\", t(\"mcp.connected\"));\n          finishPerf(options.developerMode(), \"mcp.connect\", \"done\", startedAt, {","sourceCodeStart":739,"sourceCodeEnd":775,"githubUrl":"https://github.com/different-ai/openwork/blob/2b7df46e8ae1517d64c896c7793d2d52ec845669/apps/app/src/react-app/domains/connections/store.ts#L739-L775","documentation":"For a managedBy 'openwork-connect' entry with a valid slug, the repair path requires the OpenWork server: canUseOpenworkServer true, an openworkClient instance, and an openworkWorkspaceId. If any is missing, the store throws 'OpenWork server is required to repair agent access to connected services.' because reconciling cloud MCP access can only be done through the server.","triggerScenarios":"Attempting to connect/repair an openwork-connect managed MCP entry while signed out of OpenWork Cloud (no workspace id), with the server integration disabled (canUseOpenworkServer false), or with no openworkClient available.","commonSituations":"User not signed in to OpenWork Cloud tries to repair a connected service; self-hosted setup where the OpenWork server piece isn't running; web/workspace runtime without the desktop server client wired up.","solutions":["Sign in to OpenWork Cloud so openworkWorkspaceId and the client are available","Start/enable the local OpenWork server and confirm canUseOpenworkServer is true before repairing","Ensure the store's openworkClient factory is wired (pass the client when constructing the connections store)","Route the repair through a desktop session where the server integration is active"],"exampleFix":"// before\nawait connectionsStore.connect(entry);\n// after\nif (!(canUseOpenworkServer && openworkClient && openworkWorkspaceId)) {\n  await signInToOpenworkCloud(); // establishes client + workspace id\n}\nawait connectionsStore.connect(entry);","handlingStrategy":"validation","validationCode":"const ready = canUseOpenworkServer && openworkClient != null && openworkWorkspaceId != null;\nif (!ready) { promptSignInOrStartServer(); return; }","typeGuard":"function canRepairCloudMcp(s: { canUseOpenworkServer: boolean; openworkClient: unknown; openworkWorkspaceId: string | null }): boolean {\n  return s.canUseOpenworkServer && s.openworkClient != null && s.openworkWorkspaceId != null;\n}","tryCatchPattern":"try {\n  await connectionsStore.connect(entry);\n} catch (err) {\n  if (err.message.includes(\"OpenWork server is required\")) {\n    await signInToOpenworkCloud();\n    await connectionsStore.connect(entry);\n  } else throw err;\n}","preventionTips":["Verify server availability (canUseOpenworkServer) before offering repair actions","Require OpenWork Cloud sign-in before showing managed-service repair UI","Ensure openworkClient is passed when constructing the connections store","Self-hosted setups: run the OpenWork server component, not just the desktop app"],"tags":["mcp","openwork-server","prerequisites","sign-in"],"backgroundTag":"required-service-unavailable","analyzedSha":"2b7df46e8ae1517d64c896c7793d2d52ec845669","analyzedAt":"2026-09-01T07:59:23.713Z","contentChangedAt":null,"schemaVersion":2},"datasetVersion":"2026-09-08T10:18:20.063Z"}