fix(install): install a hermes-acp launcher onto PATH - #73477
Closed
SHL0MS wants to merge 1 commit into
Closed
Conversation
setup_path() wrote a `hermes` launcher to ~/.local/bin but nothing for `hermes-acp`. That console script exists only inside the venv, which is not on the login-shell PATH. ACP hosts resolve the agent by command name against that PATH, so an otherwise healthy install looks absent to them. Buzz Desktop ships a Hermes preset that spawns `hermes-acp` and reports the runtime as unavailable; Zed and JetBrains configs that name the bare command have the same problem. Write a hermes-acp launcher next to the hermes one, dispatching to the acp subcommand. Same PYTHONPATH/PYTHONHOME clearing, and the same rm -f before cat > so an older symlink into the venv cannot be followed and stomp the console script (NousResearch#21454). Uninstall removes both launchers. tests/test_install_sh_acp_launcher.py drives the block out of install.sh rather than asserting on a copy, covering the venv and non-venv branches plus the symlink-stomp case. Reverting the install.sh change turns all three red. Signed-off-by: SHL0MS <SHL0MS@users.noreply.github.com>
Contributor
|
Merged via PR #73501 with your authorship preserved on both commits (a7d5147 — the install.sh launcher, and fda7714 — the Buzz permission-auto-approval warning). On top of your fix we added a |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
setup_path()writes ahermeslauncher into~/.local/binbut nothing forhermes-acp. Thehermes-acpconsole script from[project.scripts]lands in the venv, and the venv is not on the login-shell PATH.ACP hosts resolve the agent by command name against that PATH, so a working install reads as missing to them. Concretely, Buzz Desktop 0.5.0 ships a Hermes preset that spawns
hermes-acpand marks the runtime unavailable, which suppresses its row entirely. Zed and JetBrains configs that name the bare command hit the same wall.This writes a
hermes-acplauncher alongside thehermesone, dispatching to theacpsubcommand. It reuses the existing pattern: samePYTHONPATH/PYTHONHOMEclearing, samerm -fbeforecat >so an older symlink pointing into the venv cannot be followed and overwrite the console script (#21454). Both venv and non-venv branches are covered, and uninstall now removes both launchers.Why a launcher and not a symlink
A symlink into
venv/bin/hermes-acpreintroduces #21454 on the next install, and uv-generated console scripts resolve themselves throughrealpath, which stock macOS lacks. That is the reasoning already recorded in the comment above thehermesshim, so this follows it rather than inventing a second mechanism.Verification
tests/test_install_sh_acp_launcher.pyextracts the block out ofscripts/install.shwith a regex and executes it under bash, the same approachtest_install_sh_symlink_stomp.pytakes, so the test cannot drift from a hand-copied duplicate of the shim.Three cases: the venv branch produces an executable launcher that dispatches to
acp, the non-venv branch does the same, and a pre-existing symlink at the target path gets replaced instead of followed.Neighbouring suites still pass together:
End to end on macOS, the generated launcher answers
initializeover stdio:{"agentInfo":{"name":"hermes-agent","version":"0.19.0"}, "agentCapabilities":{"loadSession":true, "sessionCapabilities":{"fork":{},"list":{},"resume":{}}}}Note on the host side
Buzz can also resolve the preset as
hermes acp, which fixes this for installs that already exist. I opened block/buzz#3334 for that. This change is still worth having on its own: it makes thehermes-acpname work for any host that expects a dedicated ACP binary, without each one needing to know that Hermes exposes ACP as a subcommand.