hermes - ✅(Solved) Fix install.sh corrupts venv `hermes` entry-point when ~/.local/bin/hermes is a symlink [1 pull requests, 1 comments, 2 participants]

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…
GitHub stats
NousResearch/hermes-agent#24834Fetched 2026-05-14 03:51:23
View on GitHub
Comments
1
Participants
2
Timeline
5
Reactions
0
Timeline (top)
labeled ×3commented ×1cross-referenced ×1

Fix Action

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
...

PR fix notes

PR #24850: fix(install): rm symlink before writing hermes launcher to prevent venv corruption

Description (problem / solution / changelog)

Summary

When ~/.local/bin/hermes is a symlink pointing into the venv (state left by an earlier install), cat > $command_link_dir/hermes follows the symlink and overwrites the real Python entry-point with the bash launcher template. The launcher then execs itself in an infinite loop and hermes hangs forever.

Changes

  • Add rm -f "$command_link_dir/hermes" before the cat > redirect in scripts/install.sh so any existing file or symlink is removed first, ensuring the redirect always creates a fresh regular file.

How to test

  1. Create the problematic state: ln -sf ~/.hermes/hermes-agent/venv/bin/hermes ~/.local/bin/hermes
  2. Run scripts/install.sh
  3. Verify hermes --help works (no hang)
  4. Verify ~/.local/bin/hermes is a regular file, not a symlink
  5. Verify ~/.hermes/hermes-agent/venv/bin/hermes is still the Python console-script

Related

Fixes #24834

Changed files

  • scripts/install.sh (modified, +3/-0)

Code Example

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

---

mkdir -p "$command_link_dir"
rm -f "$command_link_dir/hermes"
cat > "$command_link_dir/hermes" <<EOF
...
RAW_BUFFERClick to expand / collapse

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.

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