hermes - 💡(How to fix) Fix Bug: Re-running install.sh on prior install creates infinite-loop shim (CLI hangs)

Official PRs (…)
ON THIS PAGE

Recommended Tools

×6

Utilities matched from this issue’s tags and category — try them while you read without losing context.

GitHub issue graph ai analysis

Paste a GitHub issue URL. We fetch that issue, discover linked issues from bodies/comments/timeline, collect linked pull requests, and produce a structured English report.

The report is written in English Markdown for sharing and archival.

Helpful · Quick feedback

Loading…

Re-running install.sh on a system that was previously installed with an older version of the script destroys the pip-generated venv/bin/hermes entry point, replacing it with a bash shim that calls itself in an infinite loop. The hermes command hangs immediately on any invocation.

Root Cause

Commit 043a118d4 ("fix: harden install.sh against inherited Python env leakage") changed setup_path() in scripts/install.sh from:

ln -sf "$HERMES_BIN" "$command_link_dir/hermes"

to:

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

The problem: On a prior install, ~/.local/bin/hermes is a symlink to ~/.hermes/hermes-agent/venv/bin/hermes (the pip-generated Python entry point). When the new cat > writes to $command_link_dir/hermes, it writes through the symlink and overwrites the pip entry point with the bash shim. Since $HERMES_BIN resolves to the same path, the shim calls itself in an infinite loop.

Fix Action

Fix

Add rm -f before cat > in setup_path() so the old symlink is removed before the new shim is written:

mkdir -p "$command_link_dir"
rm -f "$command_link_dir/hermes"          # ← remove old symlink first
cat > "$command_link_dir/hermes" <<EOF
#!/usr/bin/env bash
unset PYTHONPATH
unset PYTHONHOME
exec "$HERMES_BIN" "\$@"
EOF
chmod +x "$command_link_dir/hermes"

Workaround

If already affected, restore the pip entry point at ~/.hermes/hermes-agent/venv/bin/hermes:

#!/home/user/.hermes/hermes-agent/venv/bin/python3
# -*- coding: utf-8 -*-
import sys
from hermes_cli.main import main
if __name__ == "__main__":
    sys.exit(main())

(Replace user with your username, matching the venv Python path.)

Code Example

ln -sf "$HERMES_BIN" "$command_link_dir/hermes"

---

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

---

# Observe the infinite loop:
$ cat ~/.hermes/hermes-agent/venv/bin/hermes
#!/usr/bin/env bash
unset PYTHONPATH
unset PYTHONHOME
exec "/home/user/.hermes/hermes-agent/venv/bin/hermes" "$@"
# ↑ calls itself!

---

mkdir -p "$command_link_dir"
rm -f "$command_link_dir/hermes"          # ← remove old symlink first
cat > "$command_link_dir/hermes" <<EOF
#!/usr/bin/env bash
unset PYTHONPATH
unset PYTHONHOME
exec "$HERMES_BIN" "\$@"
EOF
chmod +x "$command_link_dir/hermes"

---

#!/home/user/.hermes/hermes-agent/venv/bin/python3
# -*- coding: utf-8 -*-
import sys
from hermes_cli.main import main
if __name__ == "__main__":
    sys.exit(main())
RAW_BUFFERClick to expand / collapse

Summary

Re-running install.sh on a system that was previously installed with an older version of the script destroys the pip-generated venv/bin/hermes entry point, replacing it with a bash shim that calls itself in an infinite loop. The hermes command hangs immediately on any invocation.

Root Cause

Commit 043a118d4 ("fix: harden install.sh against inherited Python env leakage") changed setup_path() in scripts/install.sh from:

ln -sf "$HERMES_BIN" "$command_link_dir/hermes"

to:

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

The problem: On a prior install, ~/.local/bin/hermes is a symlink to ~/.hermes/hermes-agent/venv/bin/hermes (the pip-generated Python entry point). When the new cat > writes to $command_link_dir/hermes, it writes through the symlink and overwrites the pip entry point with the bash shim. Since $HERMES_BIN resolves to the same path, the shim calls itself in an infinite loop.

Reproduction

  1. Install Hermes with a version of install.sh from before May 6, 2026 (uses ln -sf). This creates ~/.local/bin/hermes as a symlink → venv/bin/hermes.
  2. Re-run install.sh from commit 043a118d4 or later.
  3. hermes now hangs — the pip entry point at venv/bin/hermes has been replaced with the self-referencing bash shim.
# Observe the infinite loop:
$ cat ~/.hermes/hermes-agent/venv/bin/hermes
#!/usr/bin/env bash
unset PYTHONPATH
unset PYTHONHOME
exec "/home/user/.hermes/hermes-agent/venv/bin/hermes" "$@"
# ↑ calls itself!

Fix

Add rm -f before cat > in setup_path() so the old symlink is removed before the new shim is written:

mkdir -p "$command_link_dir"
rm -f "$command_link_dir/hermes"          # ← remove old symlink first
cat > "$command_link_dir/hermes" <<EOF
#!/usr/bin/env bash
unset PYTHONPATH
unset PYTHONHOME
exec "$HERMES_BIN" "\$@"
EOF
chmod +x "$command_link_dir/hermes"

Workaround

If already affected, restore the pip entry point at ~/.hermes/hermes-agent/venv/bin/hermes:

#!/home/user/.hermes/hermes-agent/venv/bin/python3
# -*- coding: utf-8 -*-
import sys
from hermes_cli.main import main
if __name__ == "__main__":
    sys.exit(main())

(Replace user with your username, matching the venv Python path.)

Environment

  • Fedora 43, Linux x86_64
  • Hermes Agent v0.12.0 (2026.4.30)
  • Python 3.11.15
  • Install method: curl -fsSL https://raw.githubusercontent.com/NousResearch/hermes-agent/main/scripts/install.sh | bash

Vote matrix · Quick signals

Works
Did the solution work? Tap to confirm.
Easy Fix
Was it a quick fix?
Time Saver
Did it save you time?
Blocking
Was it severely blocking?
Common Issue
Are others likely hitting this too?
Flaky / Intermittent
Is it intermittent?
Verified / Reproducible
Can you reproduce it reliably?
Loading…

Still need to ship something?

×6

Another batch ranked right after the header list — different links, same matching logic.

Back to top recommendations

TRENDING