{"record":{"id":"3c6f4ffb2e5612d0","repo":"different-ai/openwork","slug":"computer-use-is-mac-only-and-requires-the-openwork","errorCode":null,"errorMessage":"Computer Use is Mac only and requires the OpenWork desktop app on macOS.","messagePattern":"Computer Use is Mac only and requires the OpenWork desktop app on macOS\\.","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"apps/app/src/react-app/domains/settings/computer-use-config.tsx","lineNumber":113,"sourceCode":"    refetch,\n  } = useQuery({\n    queryKey: PERMISSIONS_QUERY_KEY,\n    queryFn: async () => parsePermissionResult(await desktopBridge.checkComputerUsePermissions()),\n    enabled: hasDesktopBridge(),\n    retry: false,\n    refetchOnWindowFocus: false,\n  });\n\n  // Opens the setup GUI; it returns a fresh read that becomes the cached state.\n  const {\n    mutate: grant,\n    isPending: isGrantPending,\n    error: grantError,\n    reset: resetGrant,\n  } = useMutation({\n    mutationFn: async () => {\n      if (!hasDesktopBridge()) {\n        throw new Error(\"Computer Use is Mac only and requires the OpenWork desktop app on macOS.\");\n      }\n\n      return parsePermissionResult(await desktopBridge.openComputerUsePermissionSetup());\n    },\n    onSuccess: (next) => {\n      queryClient.setQueryData(PERMISSIONS_QUERY_KEY, next);\n    },\n  });\n\n  const isBusy = isFetching || isGrantPending;\n  const error = (grantError ?? checkError)?.message ?? result?.error ?? null;\n\n  // Bubble the latest read up to the parent.\n  useEffect(() => {\n    if (result) {\n      onPermissionsChange?.({ accessibility: result.accessibility, screenRecording: result.screenRecording });\n    }\n  }, [result, onPermissionsChange]);","sourceCodeStart":95,"sourceCodeEnd":131,"githubUrl":"https://github.com/different-ai/openwork/blob/2b7df46e8ae1517d64c896c7793d2d52ec845669/apps/app/src/react-app/domains/settings/computer-use-config.tsx#L95-L131","documentation":"The Computer Use permission grant flow requires the desktop bridge (Electron native APIs) because it opens the macOS permission setup and parses a native permission result. When hasDesktopBridge() is false (web build, non-macOS, or bridge not injected), the mutation throws since Computer Use is only supported in the macOS desktop app.","triggerScenarios":"Clicking the grant/enable Computer Use permission button in ComputerUseConfig while hasDesktopBridge() returns false — e.g. running the web UI, Windows/Linux desktop, or the bridge failed to preload in Electron.","commonSituations":"User opens OpenWork in a browser and visits the Computer Use settings page; desktop app built/running on Windows or Linux; Electron preload script failed so window bridge is missing even on macOS.","solutions":["Use the OpenWork desktop app on macOS to configure Computer Use","If on macOS desktop but still failing, restart the app — a failed preload can hide the bridge; check for preload errors in devtools","Hide/disable the Computer Use section when hasDesktopBridge() is false instead of exposing a throwing action","Verify the app build includes the computer-use bridge module"],"exampleFix":"// before\n<button onClick={() => grantMutation.mutate()}>Enable Computer Use</button>\n// after\n{hasDesktopBridge() && (\n  <button onClick={() => grantMutation.mutate()}>Enable Computer Use</button>\n)}","handlingStrategy":"validation","validationCode":"if (!hasDesktopBridge()) {\n  toast.info(\"Computer Use requires the OpenWork macOS desktop app.\");\n  return;\n}","typeGuard":"const hasDesktopBridgeGuard = (): bridge is DesktopBridge =>\n  typeof window !== \"undefined\" && hasDesktopBridge();","tryCatchPattern":"try {\n  await grantMutation.mutateAsync();\n} catch (e) {\n  if (e instanceof Error && e.message.includes(\"Mac only\")) {\n    toast.info(\"Open the OpenWork desktop app on macOS to enable Computer Use.\");\n  } else throw e;\n}","preventionTips":["Conditionally render Computer Use settings only when hasDesktopBridge() is true","Detect platform at app startup and tailor the settings surface","Verify the Electron preload injects the bridge before showing grant actions","Document platform requirements on the settings page"],"tags":["macos","desktop-bridge","computer-use","platform-support"],"backgroundTag":"desktop-bridge-unavailable","analyzedSha":"2b7df46e8ae1517d64c896c7793d2d52ec845669","analyzedAt":"2026-09-01T07:59:23.713Z","contentChangedAt":null,"schemaVersion":2},"datasetVersion":"2026-09-08T10:18:20.063Z"}