{"record":{"id":"d77f384fd221cd9a","repo":"different-ai/openwork","slug":"helper-binary-not-found-run-pnpm-dev-to-build-it","errorCode":null,"errorMessage":"Helper binary not found. Run pnpm dev to build it.","messagePattern":"Helper binary not found\\. Run pnpm dev to build it\\.","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"apps/desktop/electron/computer-use.mjs","lineNumber":154,"sourceCode":"        resolve({ ok: false, apps: [] });\n      }\n    });\n  });\n}\n\nasync function openComputerUseSetupApp() {\n  // Open the GUI. Use the .app bundle if available so macOS shows it as\n  // a real app with its own dock icon and permission identity.\n  const appPath = computerUseHelperAppPath();\n  if (appPath) {\n    const result = await shell.openPath(appPath);\n    if (result) console.error(\"[ComputerUse] shell.openPath error:\", result);\n    return;\n  }\n\n  // Fallback: spawn the raw binary (opens the same GUI).\n  const bin = resolveComputerUseExecutable();\n  if (!bin) throw new Error(\"Helper binary not found. Run pnpm dev to build it.\");\n  const child = spawn(bin, [], { detached: true, stdio: \"ignore\" });\n  child.unref();\n}\n\nexport {\n  checkComputerUsePermissions,\n  getComputerUseMcpCommand,\n  listRunningApps,\n  openComputerUseSetupApp,\n};\n","sourceCodeStart":136,"sourceCodeEnd":165,"githubUrl":"https://github.com/different-ai/openwork/blob/2b7df46e8ae1517d64c896c7793d2d52ec845669/apps/desktop/electron/computer-use.mjs#L136-L165","documentation":"openComputerUseSetupApp opens the macOS Computer Use permission setup GUI. It first tries shell.openPath on the bundled .app; if absent, it falls back to spawning the raw helper binary resolved by resolveComputerUseExecutable(). When neither the .app bundle nor the binary exists on disk, it throws this error, because the helper is built by the dev toolchain, not shipped inside the main app.","triggerScenarios":"Calling openComputerUseSetupApp() on macOS when neither computerUseHelperAppPath() nor resolveComputerUseExecutable() resolves to an existing file — e.g. running the app from source before building the helper, a partial/cleaned build, or running a packaged build that omitted the helper.","commonSituations":"Developers cloning the repo and running the Electron app without running the full build first; CI packaging steps that skip the helper build; running the app from a non-default working directory so the helper path resolution fails.","solutions":["Run `pnpm dev` (or the repo's full build) so the Computer Use helper binary/bundle is produced before launching the app.","Verify the helper exists at the path resolveComputerUseExecutable() computes (resources/helper dirs) and that the app is launched from the repo root or correct packaged layout.","Re-run packaging so the helper is bundled with the app if the error occurs in production builds.","Guard the call with existence checks and show the user a 'setup unavailable, rebuild the app' message instead of crashing."],"exampleFix":"// before\nopenComputerUseSetupApp(); // throws if helper missing\n// after\nif (computerUseHelperAppPath() || resolveComputerUseExecutable()) {\n  await openComputerUseSetupApp();\n} else {\n  console.error('Computer Use helper not built. Run pnpm dev first.');\n}","handlingStrategy":"fallback","validationCode":"import { existsSync } from 'node:fs';\nconst bin = resolveComputerUseExecutable();\nconst appPath = computerUseHelperAppPath();\nif (!appPath && !(bin && existsSync(bin))) {\n  console.error('Computer Use helper not built — run pnpm dev.');\n}","typeGuard":"function hasComputerUseHelper() {\n  return Boolean(computerUseHelperAppPath() || resolveComputerUseExecutable());\n}","tryCatchPattern":"try {\n  await openComputerUseSetupApp();\n} catch (err) {\n  if (String(err.message).includes('Helper binary not found')) {\n    showDialog('Computer Use setup is unavailable. Rebuild the app (pnpm dev) and try again.');\n  } else throw err;\n}","preventionTips":["Always run the full `pnpm dev` build before exercising Computer Use flows from source.","Add a packaging check asserting the helper binary exists in the built app bundle.","Fail fast at app boot with a warning if the helper is absent on macOS.","Keep working directory and resource paths stable so resolveComputerUseExecutable() resolves correctly."],"tags":["macos","missing-binary","build"],"backgroundTag":"missing-helper-binary","analyzedSha":"2b7df46e8ae1517d64c896c7793d2d52ec845669","analyzedAt":"2026-09-01T07:59:23.713Z","contentChangedAt":null,"schemaVersion":2},"datasetVersion":"2026-09-08T10:18:20.063Z"}