fix(launcher): add non-standard binary discovery fallback for Aider CLI - #715
AseemPrasad wants to merge 1 commit into
Conversation
|
@AseemPrasad is attempting to deploy a commit to the Raphael's projects Team on Vercel. A member of the Team first needs to authorize it. |
zomux
left a comment
There was a problem hiding this comment.
Thanks for the report — Aider installed by uv tool / pip not being found from a GUI-launched daemon is a real class of bug. Requesting changes, for two reasons: the patch as pushed crashes, and the fix is in the wrong layer.
1. It throws on every not-installed check. findNonStandardBinaryPath calls os.homedir() but install-service.ts never imports os. The PR's own new test fails on a merge with current develop with ReferenceError: os is not defined, and checkAgentType now calls the helper whenever which returns null — so the launcher's install check would throw for every agent that isn't installed, not just Aider. (The test would not have caught a correct run either: expect(typeof x === 'string' || x === null) is always true.)
2. The core already searches every directory on this list, and detection must have one source of truth. packages/agent-connector/src/paths.js getKnownBinDirs() covers ~/.local/bin, ~/.cargo/bin, XDG_BIN_HOME, XDG_DATA_HOME/../bin, the uv tool venv (%APPDATA%\uv\tools\<pkg>\Scripts / ~/.local/share/uv/tools/<pkg>/bin via uvToolBinDirs('aider-chat')), the pip user Scripts dirs on Windows, and finally whatever the login shell puts on PATH. The launcher's installer.which() resolves through that list, and so does the Aider adapter when it spawns. The connector's CLAUDE.md is explicit about this: a private candidate list outside getKnownBinDirs() is the shape of every bug in this area so far (#648), because the marketplace and the daemon then disagree about whether the CLI exists — which is exactly what installed: Boolean(installed || binary) would produce here: the launcher says installed, the core's isInstalled says not, and the adapter fails at spawn.
The message you quote ("…the Aider CLI could not be located") is raised by the core installer right after the install command completes, which means the core's own detection missed the binary on your machine. That's the thing worth fixing. Could you tell us:
- OS and launcher version (
agn --version/ About), and - the actual path of the
aiderexecutable on that machine (which aider/where aiderfrom a terminal, or the uv tool dir).
If it's in a directory getKnownBinDirs() doesn't cover, the right change is a rule in _addAgentInstallerPaths() / uvToolBinDirs() in paths.js plus a route in test/agent-detection-matrix.test.js, and both the launcher and the adapter pick it up at once. Happy to review that version quickly.
… to uvToolBinDirs
8e9ef4a to
b3a761c
Compare
|
Thank you for the detailed and insightful code review! I have updated the PR,
|
fix(launcher): add non-standard binary discovery fallback for Aider CLI
Description
This PR fixes an issue where Python/
uv-installed agent binaries (specifically Aider, installed viauv tool installorpip install aider-chat) fail launcher readiness checks with:This occurs when the target binary installation directory (
~/.local/bin,$XDG_DATA_HOME/../bin, or%APPDATA%\Python\Scripts) is not present on the active processPATHof the running launcher daemon.Type of Change
Detailed Changes
packages/launcher/src/main/agents/install-service.ts:findNonStandardBinaryPath(agentType, binaryName)helper to inspect standard tool fallback locations:$XDG_BIN_HOME,$XDG_DATA_HOME/../bin,~/.local/bin,~/.cargo/bin.%APPDATA%\Python\Scripts,%APPDATA%\uv\tools,%LOCALAPPDATA%\Programs\uv\bin,%USERPROFILE%\.local\bin.checkAgentType(agentType)to queryfindNonStandardBinaryPathas a secondary fallback whenever the primary connectorwhich()resolution returnsnull.packages/launcher/src/main/agents/install-service.test.ts:How Has This Been Tested?
checkAgentTypesucceeds when Aider is installed in~/.local/bin/%APPDATA%\Python\Scriptseven if the directory is missing fromprocess.env.PATH.codex,openclaw,cursor,claude).Checklist
develop.