Warn when another ao on PATH shadows the app's bundled CLI
Problem
A user turned on Settings → Remote hosts → Allow access from your devices and then ran ao remote-host status in an AO terminal to get the connection details. The command failed with:
unknown command "remote-host" for "ao"
The cause was an older ao that came before the app's bundled CLI on PATH. AO starts terminals with …/Agent Orchestrator.app/Contents/Resources/daemon first on PATH. The user's ~/.zshrc and ~/.zprofile then unconditionally prepend ~/.local/bin, which held a symlink to a local dev build from June that predates remote-host. A broken npm link of @aoagents/ao (it failed with "no prebuilt binary for darwin-arm64") was also on PATH.
Nothing told the user their ao was not the app's ao. The error looked like an AO bug.
What already exists
ao doctorhas acheckAOBinarycheck (backend/internal/cli/doctor.go) that flags anaoonPATHshadowing the daemon's binary. However:- it only runs when someone asks for it;
- when a shadow exists, typing
ao doctorruns the shadowing binary, which may be too old to have the check.
- The desktop CLI link status (
frontend/src/shared/cli-link.ts,pathIssue) is Developer Mode only.
Proposal
Warn proactively when the ao a user's shell resolves is not the bundled CLI:
- Desktop app: on startup (and maybe when Settings opens), resolve
aothrough the user's login and interactive shell env (the sameshell-envprobe the app already uses). If it does not resolve to the bundled binary, show a non-blocking notice. The notice should give the shadowing path and version, the bundled path, and the fix: remove or reorder the shadowing install. Never edit the shell rc files automatically. - CLI: when the bundled CLI is invoked by full path or by the daemon, it could cheaply note a shadow. Item 1 is the main fix, though, because the stale binary can't warn about itself.
- Optionally, make docs and settings copy that tells users to run
ao …mention the full bundled path as a fallback.
Acceptance
- With a different
aofirst on the interactive shell'sPATH, the desktop app shows a warning naming both paths. - With the bundled
aofirst (or a symlink to it, such as the Developer Mode CLI link), no warning appears. - No shell startup files are modified.
Hi can I work on this ?
@rhithesh sure, pick up the issue and try to reproduce it. If needed, make a PR and add visual proof as well for the fix