{"record":{"id":"c5049c15d02ce86e","repo":"can1357/oh-my-pi","slug":"could-not-resolve-app-name-binary-path-in-path","errorCode":null,"errorMessage":"Could not resolve ${APP_NAME} binary path in PATH","messagePattern":"Could not resolve (.+?) binary path in PATH","errorType":"exception","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"packages/coding-agent/src/cli/update-cli.ts","lineNumber":755,"sourceCode":"\t// case stays probe-free.\n\tconst probeManagers = options.allowPackageManagers || (ompPath !== undefined && isSymlinkPath(ompPath));\n\tconst bunBinDir = probeManagers ? await getBunGlobalBinDir() : undefined;\n\tconst npmBinDir = probeManagers ? await getNpmGlobalBinDir() : undefined;\n\n\tif (ompPath) {\n\t\treturn resolveUpdateTargetFromPath(ompPath, bunBinDir, {\n\t\t\tallowPackageManagers: options.allowPackageManagers,\n\t\t\tbunGlobalDir: probeManagers ? process.env.BUN_INSTALL_GLOBAL_DIR : undefined,\n\t\t\thomebrewPrefix,\n\t\t\tmiseBinDirs,\n\t\t\tmiseDataDir,\n\t\t\tnpmBinDir,\n\t\t});\n\t}\n\n\tif (bunBinDir) return { method: \"bun\" };\n\n\tthrow new Error(`Could not resolve ${APP_NAME} binary path in PATH`);\n}\n\n/** Bound on `omp.rename` hops so a broken pointer chain cannot loop forever. */\nconst MAX_RENAME_HOPS = 3;\n\nasync function fetchLatestManifest(\n\tpkg: string,\n\ttimeoutMs: number,\n\tchannel: UpdateChannel,\n): Promise<{ version: string; manifest: Record<string, unknown> }> {\n\tlet response: Response;\n\ttry {\n\t\tresponse = await fetch(`${NPM_REGISTRY}${pkg}/${channel === \"canary\" ? \"canary\" : \"latest\"}`, {\n\t\t\tsignal: withTimeoutSignal(timeoutMs),\n\t\t});\n\t} catch (err) {\n\t\tif (isTimeoutError(err)) {\n\t\t\tthrow new Error(`Timed out fetching release info for ${pkg} after ${Math.round(timeoutMs / 1000)}s`, {","sourceCodeStart":737,"sourceCodeEnd":773,"githubUrl":"https://github.com/can1357/oh-my-pi/blob/969062200754ea02cfac922e5ebb8c608c079e15/packages/coding-agent/src/cli/update-cli.ts#L737-L773","documentation":"Thrown when the updater finishes probing the PATH for a known installation layout (npm global bin dir, bun bin dir, omp.rename shim chains) and can none-the-less determine how the running omp binary was installed. The updater needs the on-disk location of the current binary to replace it during a self-update; without resolvable evidence (npm prefix bin, bun bin, or a recognized shim), it aborts rather than overwriting the wrong file.","triggerScenarios":"omp was launched via an un recognized install method: a manually copied binary in a dir on PATH not managed by npm/bun, a Homebrew/Linuxbrew install, a cargo/nix install, a symlink whose target chain exhausts MAX_RENAME_HOPS, or PATH lacking both npm and bun bin directories in this shell.","commonSituations":"Installing via `brew install omp` and then trying the built-in self-updater; curl|sh installs dropped into ~/.local/bin without a shim; containers where PATH is minimal; running from a build checkout (`bun run dev`) with no npm/bun global install present.","solutions":["Install through a supported package manager (npm: `npm i -g @oh-my-pi/coding-agent`, or bun) so the updater can resolve the bin dir, then run `omp update`.","If installed via Homebrew or another system manager, update with that tool (`brew upgrade omp`) instead of the built-in updater.","Check `which -a omp` and echo $PATH — ensure the npm bin (`npm bin -g`/`npm prefix -g`/bin) or `~/.bun/bin` is on PATH in the shell performing the update."],"exampleFix":"// before: manual binary copy, updater cannot resolve origin\n$ omp update\n// Error: Could not resolve omp binary path in PATH\n// after: install via npm so the updater can manage it\n$ npm i -g @oh-my-pi/coding-agent && omp update","handlingStrategy":"validation","validationCode":"const whichOmp = Bun.which(\"omp\");\nconst npmBin = Bun.which(\"npm\"), bunBin = Bun.which(\"bun\");\nif (!whichOmp || (!npmBin && !bunBin)) {\n  throw new Error(\"omp or a supported package manager (npm/bun) missing from PATH; self-update unavailable\");\n}","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Install omp via npm or bun so the self-updater can resolve its location","Use brew/system package manager updates for non-npm/bun installs","Keep npm/bun bin dirs on PATH in every shell that runs `omp update`"],"tags":["installation","path","update-cli","environment"],"backgroundTag":"binary-not-found","analyzedSha":"969062200754ea02cfac922e5ebb8c608c079e15","analyzedAt":"2026-08-31T10:29:35.737Z","schemaVersion":2},"datasetVersion":"2026-08-31T14:17:45.589Z"}