musistudio/claude-code-router · error · Error
OpenCode App was not found. Install OpenCode App or set OPEN
Error message
OpenCode App was not found. Install OpenCode App or set OPENCODE_APP_PATH to its executable, then try again.
What it means
launchOpenCodeAppProfile could not find the OpenCode App executable via findInstalledOpenCodeAppExecutable(profile.appPath); the message lists every path checked and points to OPENCODE_APP_PATH.
Source
Thrown at packages/core/src/agents/opencode/app-launch.ts:64
const executable = findInstalledOpenCodeAppExecutable(profileAppPath).executable;
if (!executable) {
return undefined;
}
return process.platform === "win32"
? findWindowsExecutablePid(executable)
: findPosixExecutablePid(executable);
}
export function launchOpenCodeAppProfile(
_configDir: string,
profile: ProfileConfig,
configFile: string,
inlineConfig: string,
extraEnv: Record<string, string> = {}
): OpenCodeAppLaunchResult {
const lookup = findInstalledOpenCodeAppExecutable(profile.appPath);
if (!lookup.executable) {
throw new Error([
"OpenCode App was not found. Install OpenCode App or set OPENCODE_APP_PATH to its executable, then try again.",
lookup.checked.length ? `Checked: ${lookup.checked.join(", ")}` : ""
].filter(Boolean).join(" "));
}
const userDataDir = resolveOpenCodeDesktopUserDataDir();
const env: NodeJS.ProcessEnv = {
...process.env,
...profile.env,
...extraEnv,
CCR_PROFILE_SURFACE: "app",
OPENCODE_CLIENT: "desktop",
OPENCODE_CONFIG: configFile,
OPENCODE_CONFIG_CONTENT: inlineConfig
};
delete env.ELECTRON_RUN_AS_NODE;
const child = spawn(lookup.executable, openCodeAppLaunchArgs(), {
detached: true,
env,View on GitHub (pinned to 99f24806c6)
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.
Example fix
# before export OPENCODE_APP_PATH=/wrong/path/opencode # after export OPENCODE_APP_PATH=/usr/local/bin/opencode-app # actual executable
Defensive patterns
Strategy: validation
Validate before calling
const exe = process.env.OPENCODE_APP_PATH ?? defaultAppPath();
if (!existsSync(exe)) throw new Error(`set OPENCODE_APP_PATH (checked ${exe})`); Type guard
function appExecutableAvailable(path: string): boolean { try { accessSync(path, X_OK); return true; } catch { return false; } } Try / catch
catch (e) { if ((e as Error).message.startsWith('OpenCode App was not found')) promptForAppPath(); } Prevention
- Set OPENCODE_APP_PATH explicitly in scripts/CI.
- Verify executable exists after app updates.
When it happens
Trigger: Launching an OpenCode App profile when the app binary isn't at any default location nor at profile.appPath/OPENCODE_APP_PATH.
Common situations: App not installed, non-standard install location, renamed binary after an update, or OPENCODE_APP_PATH pointing at a moved file.
Related errors
- OpenCode CLI API key was not found.
- Unsupported OpenCode protocol: ${candidate.protocol}
- OpenCode CLI public models were not found.
- ToolHub resolver requires TOOLHUB_OPENAI_API_KEY and TOOLHUB
- [profile] OpenCode App bot worker stderr: ${chunk.toString("
AI-assisted analysis of musistudio/claude-code-router@99f24806c6 (2026-08-27).
Data as JSON: /api/errors/bf42d716b120ffcb.
Report an issue: GitHub.