Skip to content

install.sh corrupts venv hermes entry-point when ~/.local/bin/hermes is a symlink #24834

@AlignmentEverything

Description

@AlignmentEverything

Problem

scripts/install.sh (~line 1283) writes the user launcher via:

cat > "$command_link_dir/hermes" <<EOF
#!/usr/bin/env bash
unset PYTHONPATH
unset PYTHONHOME
exec "$HERMES_BIN" "\$@"
EOF

If $command_link_dir/hermes (default ~/.local/bin/hermes) is a symlink pointing back into the venv ($INSTALL_DIR/venv/bin/hermes), > follows the symlink and overwrites the real Python entry-point with the launcher template. The launcher then execs $HERMES_BIN — itself — and hermes hangs in an infinite exec loop with no output.

Repro

  1. Make ~/.local/bin/hermes a symlink → ~/.hermes/hermes-agent/venv/bin/hermes (state left by an earlier install on my machine).
  2. Run scripts/install.sh.
  3. hermes --help hangs forever.
  4. cat ~/.hermes/hermes-agent/venv/bin/hermes shows the bash launcher template instead of the Python console-script — it execs itself.

Fix

rm -f the target before writing, so the redirect can't pass through a symlink:

mkdir -p "$command_link_dir"
rm -f "$command_link_dir/hermes"
cat > "$command_link_dir/hermes" <<EOF
...

Env

macOS, Hermes v0.13.0.

Metadata

Metadata

Assignees

No one assigned

    Labels

    P2Medium — degraded but workaround existscomp/cliCLI entry point, hermes_cli/, setup wizardtype/bugSomething isn't working

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions