{"record":{"id":"bf42d716b120ffcb","repo":"musistudio/claude-code-router","slug":"opencode-app-was-not-found-install-opencode-app-o","errorCode":null,"errorMessage":"OpenCode App was not found. Install OpenCode App or set OPENCODE_APP_PATH to its executable, then try again.","messagePattern":"OpenCode App was not found\\. Install OpenCode App or set OPENCODE_APP_PATH to its executable, then try again\\.","errorType":"exception","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"packages/core/src/agents/opencode/app-launch.ts","lineNumber":64,"sourceCode":"  const executable = findInstalledOpenCodeAppExecutable(profileAppPath).executable;\n  if (!executable) {\n    return undefined;\n  }\n  return process.platform === \"win32\"\n    ? findWindowsExecutablePid(executable)\n    : findPosixExecutablePid(executable);\n}\n\nexport function launchOpenCodeAppProfile(\n  _configDir: string,\n  profile: ProfileConfig,\n  configFile: string,\n  inlineConfig: string,\n  extraEnv: Record<string, string> = {}\n): OpenCodeAppLaunchResult {\n  const lookup = findInstalledOpenCodeAppExecutable(profile.appPath);\n  if (!lookup.executable) {\n    throw new Error([\n      \"OpenCode App was not found. Install OpenCode App or set OPENCODE_APP_PATH to its executable, then try again.\",\n      lookup.checked.length ? `Checked: ${lookup.checked.join(\", \")}` : \"\"\n    ].filter(Boolean).join(\" \"));\n  }\n  const userDataDir = resolveOpenCodeDesktopUserDataDir();\n  const env: NodeJS.ProcessEnv = {\n    ...process.env,\n    ...profile.env,\n    ...extraEnv,\n    CCR_PROFILE_SURFACE: \"app\",\n    OPENCODE_CLIENT: \"desktop\",\n    OPENCODE_CONFIG: configFile,\n    OPENCODE_CONFIG_CONTENT: inlineConfig\n  };\n  delete env.ELECTRON_RUN_AS_NODE;\n  const child = spawn(lookup.executable, openCodeAppLaunchArgs(), {\n    detached: true,\n    env,","sourceCodeStart":46,"sourceCodeEnd":82,"githubUrl":"https://github.com/musistudio/claude-code-router/blob/99f24806c6a2c660b16e53e95211c517448a6c90/packages/core/src/agents/opencode/app-launch.ts#L46-L82","documentation":"launchOpenCodeAppProfile could not find the OpenCode App executable via findInstalledOpenCodeAppExecutable(profile.appPath); the message lists every path checked and points to OPENCODE_APP_PATH.","triggerScenarios":"Launching an OpenCode App profile when the app binary isn't at any default location nor at profile.appPath/OPENCODE_APP_PATH.","commonSituations":"App not installed, non-standard install location, renamed binary after an update, or OPENCODE_APP_PATH pointing at a moved file.","solutions":["Set OPENCODE_APP_PATH to the executable's absolute path.","Reinstall OpenCode App at a standard location.","Check the 'Checked:' list in the error to see which paths were probed and place/copy the binary there."],"exampleFix":"# before\nexport OPENCODE_APP_PATH=/wrong/path/opencode\n# after\nexport OPENCODE_APP_PATH=/usr/local/bin/opencode-app # actual executable","handlingStrategy":"validation","validationCode":"const exe = process.env.OPENCODE_APP_PATH ?? defaultAppPath();\nif (!existsSync(exe)) throw new Error(`set OPENCODE_APP_PATH (checked ${exe})`);","typeGuard":"function appExecutableAvailable(path: string): boolean { try { accessSync(path, X_OK); return true; } catch { return false; } }","tryCatchPattern":"catch (e) { if ((e as Error).message.startsWith('OpenCode App was not found')) promptForAppPath(); }","preventionTips":["Set OPENCODE_APP_PATH explicitly in scripts/CI.","Verify executable exists after app updates."],"tags":["opencode","app-launch","executable-not-found","env-var"],"backgroundTag":"executable-not-found","analyzedSha":"99f24806c6a2c660b16e53e95211c517448a6c90","analyzedAt":"2026-08-27T04:11:01.184Z","schemaVersion":2},"datasetVersion":"2026-08-27T08:17:20.692Z"}