fix(install): install a hermes-acp launcher onto PATH

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 (#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>
This commit is contained in:
SHL0MS 2026-07-28 12:41:06 -04:00 committed by Teknium
parent c136400c9e
commit a7d5147cf1
3 changed files with 155 additions and 0 deletions

View file

@ -1677,6 +1677,31 @@ EOF
chmod +x "$command_link_dir/hermes"
log_success "Installed hermes launcher → $command_link_display_dir/hermes"
# Also expose `hermes-acp`. ACP hosts (Zed, JetBrains, Buzz) resolve the
# agent by command name on the login-shell PATH, and the `hermes-acp`
# console script lives inside the venv, which is not on that PATH. Without
# this launcher those hosts report Hermes as not installed. (#21454 applies
# here too: clear the path first so `cat >` cannot follow an old symlink
# into the venv and overwrite the console script.)
rm -f "$command_link_dir/hermes-acp"
if [ "$USE_VENV" = true ]; then
cat > "$command_link_dir/hermes-acp" <<EOF
#!/usr/bin/env bash
unset PYTHONPATH
unset PYTHONHOME
exec "$HERMES_BIN" "$HERMES_ENTRYPOINT" acp "\$@"
EOF
else
cat > "$command_link_dir/hermes-acp" <<EOF
#!/usr/bin/env bash
unset PYTHONPATH
unset PYTHONHOME
exec "$HERMES_BIN" acp "\$@"
EOF
fi
chmod +x "$command_link_dir/hermes-acp"
log_success "Installed hermes-acp launcher → $command_link_display_dir/hermes-acp"
if [ "$DISTRO" = "termux" ]; then
export PATH="$command_link_dir:$PATH"
log_info "$command_link_display_dir is the native Termux command path"