can1357/oh-my-pi · error · Error
Could not resolve ${APP_NAME} binary path in PATH
Error message
Could not resolve ${APP_NAME} binary path in PATH What it means
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.
Source
Thrown at packages/coding-agent/src/cli/update-cli.ts:755
// case stays probe-free.
const probeManagers = options.allowPackageManagers || (ompPath !== undefined && isSymlinkPath(ompPath));
const bunBinDir = probeManagers ? await getBunGlobalBinDir() : undefined;
const npmBinDir = probeManagers ? await getNpmGlobalBinDir() : undefined;
if (ompPath) {
return resolveUpdateTargetFromPath(ompPath, bunBinDir, {
allowPackageManagers: options.allowPackageManagers,
bunGlobalDir: probeManagers ? process.env.BUN_INSTALL_GLOBAL_DIR : undefined,
homebrewPrefix,
miseBinDirs,
miseDataDir,
npmBinDir,
});
}
if (bunBinDir) return { method: "bun" };
throw new Error(`Could not resolve ${APP_NAME} binary path in PATH`);
}
/** Bound on `omp.rename` hops so a broken pointer chain cannot loop forever. */
const MAX_RENAME_HOPS = 3;
async function fetchLatestManifest(
pkg: string,
timeoutMs: number,
channel: UpdateChannel,
): Promise<{ version: string; manifest: Record<string, unknown> }> {
let response: Response;
try {
response = await fetch(`${NPM_REGISTRY}${pkg}/${channel === "canary" ? "canary" : "latest"}`, {
signal: withTimeoutSignal(timeoutMs),
});
} catch (err) {
if (isTimeoutError(err)) {
throw new Error(`Timed out fetching release info for ${pkg} after ${Math.round(timeoutMs / 1000)}s`, {View on GitHub (pinned to 9690622007)
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.
Example fix
// before: manual binary copy, updater cannot resolve origin $ omp update // Error: Could not resolve omp binary path in PATH // after: install via npm so the updater can manage it $ npm i -g @oh-my-pi/coding-agent && omp update
Defensive patterns
Strategy: validation
Validate before calling
const whichOmp = Bun.which("omp");
const npmBin = Bun.which("npm"), bunBin = Bun.which("bun");
if (!whichOmp || (!npmBin && !bunBin)) {
throw new Error("omp or a supported package manager (npm/bun) missing from PATH; self-update unavailable");
} Prevention
- 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`
When it happens
Trigger: 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.
Common situations: 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.
Related errors
- Python kernel unavailable
- Python executable not found on PATH
- ${displayName} executable not found on PATH
- ssh binary not found on PATH
- cannot access {}: Not a directory
AI-assisted analysis of can1357/oh-my-pi@9690622007 (2026-08-31).
Data as JSON: /api/errors/c5049c15d02ce86e.
Report an issue: GitHub.