Skip to content

fix(launcher): add non-standard binary discovery fallback for Aider CLI - #715

Open
AseemPrasad wants to merge 1 commit into
openagents-org:developfrom
AseemPrasad:fix/aider-binary-path-resolution
Open

AseemPrasad wants to merge 1 commit into
openagents-org:developfrom
AseemPrasad:fix/aider-binary-path-resolution

Conversation

@AseemPrasad

Copy link
Copy Markdown

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 via uv tool install or pip install aider-chat) fail launcher readiness checks with:

"the Aider CLI could not be located"

This occurs when the target binary installation directory (~/.local/bin, $XDG_DATA_HOME/../bin, or %APPDATA%\Python\Scripts) is not present on the active process PATH of the running launcher daemon.

Type of Change

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • Documentation update

Detailed Changes

  1. packages/launcher/src/main/agents/install-service.ts:

    • Added findNonStandardBinaryPath(agentType, binaryName) helper to inspect standard tool fallback locations:
      • macOS / Linux: $XDG_BIN_HOME, $XDG_DATA_HOME/../bin, ~/.local/bin, ~/.cargo/bin.
      • Windows: %APPDATA%\Python\Scripts, %APPDATA%\uv\tools, %LOCALAPPDATA%\Programs\uv\bin, %USERPROFILE%\.local\bin.
    • Updated checkAgentType(agentType) to query findNonStandardBinaryPath as a secondary fallback whenever the primary connector which() resolution returns null.
  2. packages/launcher/src/main/agents/install-service.test.ts:

    • Added unit test suite covering non-standard binary path fallback resolution.

How Has This Been Tested?

  • Verified that checkAgentType succeeds when Aider is installed in ~/.local/bin / %APPDATA%\Python\Scripts even if the directory is missing from process.env.PATH.
  • Verified zero side effects or regression for standard npm-backed agent lookups (codex, openclaw, cursor, claude).

Checklist

  • My code follows the style guidelines of this project (PEP 8 for Python / ESLint for TS).
  • I have performed a self-review of my own code.
  • I have added unit tests for my changes.
  • All new and existing tests pass locally.
  • My branch is up to date with develop.

@vercel

vercel Bot commented Sep 24, 2026

Copy link
Copy Markdown

@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 zomux left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 aider executable on that machine (which aider / where aider from 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.

@AseemPrasad
AseemPrasad force-pushed the fix/aider-binary-path-resolution branch from 8e9ef4a to b3a761c Compare September 30, 2026 16:18
@AseemPrasad

Copy link
Copy Markdown
Author

Thank you for the detailed and insightful code review!

I have updated the PR,

  1. Refactored uvToolBinDirs() in packages/agent-connector/src/paths.js:

    • Added %APPDATA%\Python\Scripts (pip install --user) and %LOCALAPPDATA%\Programs\uv\bin (uv standalone bin) to Windows uvToolBinDirs().
    • Now installer.which(), getKnownBinDirs(), and aiderBinDirs() all resolve Python/uv-installed executables simultaneously across both Launcher detection and Adapter spawning.
  2. Added Detection Matrix Tests in packages/agent-connector/test/agent-detection-matrix.test.js:

    • Added test matrix cases for WHERE.aider verifying detection across AppData/Roaming/Python/Scripts and AppData/Local/Programs/uv/bin.

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants