diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 7f56b971d..bad33481c 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -149,13 +149,20 @@ this way, make sure you run the `hermes` entrypoint from this venv; running the system `python3 -m hermes_cli.main` can pick up unrelated system Python packages. +Create the venv **outside** the cloned source tree. A venv that lives inside +the directory the agent operates from can be wiped by a relative-path command +the agent runs against its own checkout (`rm -rf venv`, `uv venv venv`, etc.), +which silently destroys the running runtime mid-session. Keeping it outside the +tree means no relative path from the workspace resolves to it. + ```bash git clone https://github.com/NousResearch/hermes-agent.git cd hermes-agent -# Create venv with Python 3.11 -uv venv venv --python 3.11 -export VIRTUAL_ENV="$(pwd)/venv" +# Create venv with Python 3.11, OUTSIDE the source tree +uv venv ~/.hermes/venvs/hermes-dev --python 3.11 +export VIRTUAL_ENV="$HOME/.hermes/venvs/hermes-dev" +export PATH="$VIRTUAL_ENV/bin:$PATH" # Install with all extras (messaging, cron, CLI menus, dev tools) uv pip install -e ".[all,dev]" diff --git a/README.md b/README.md index 4caad13ce..ba1322a38 100644 --- a/README.md +++ b/README.md @@ -232,10 +232,14 @@ scripts/run_tests.sh Manual clone fallback (for throwaway clones/CI where you intentionally do not want the managed install layout): +Create the venv outside the cloned source tree — a venv inside the directory +the agent operates from can be wiped by a relative-path command the agent runs +against its own checkout, destroying the running runtime mid-session. + ```bash curl -LsSf https://astral.sh/uv/install.sh | sh -uv venv .venv --python 3.11 -source .venv/bin/activate +uv venv ~/.hermes/venvs/hermes-dev --python 3.11 +source ~/.hermes/venvs/hermes-dev/bin/activate uv pip install -e ".[all,dev]" scripts/run_tests.sh ``` diff --git a/website/docs/developer-guide/contributing.md b/website/docs/developer-guide/contributing.md index d290fb208..e61100a60 100644 --- a/website/docs/developer-guide/contributing.md +++ b/website/docs/developer-guide/contributing.md @@ -74,13 +74,20 @@ this way, make sure you run the `hermes` entrypoint from this venv; running the system `python3 -m hermes_cli.main` can pick up unrelated system Python packages. +Create the venv **outside** the cloned source tree. A venv that lives inside +the directory the agent operates from can be wiped by a relative-path command +the agent runs against its own checkout (`rm -rf venv`, `uv venv venv`, etc.), +which silently destroys the running runtime mid-session. Keeping it outside the +tree means no relative path from the workspace resolves to it. + ```bash git clone https://github.com/NousResearch/hermes-agent.git cd hermes-agent -# Create venv with Python 3.11 -uv venv venv --python 3.11 -export VIRTUAL_ENV="$(pwd)/venv" +# Create venv with Python 3.11, OUTSIDE the source tree +uv venv ~/.hermes/venvs/hermes-dev --python 3.11 +export VIRTUAL_ENV="$HOME/.hermes/venvs/hermes-dev" +export PATH="$VIRTUAL_ENV/bin:$PATH" # Install with all extras (messaging, cron, CLI menus, dev tools) uv pip install -e ".[all,dev]" diff --git a/website/docs/getting-started/updating.md b/website/docs/getting-started/updating.md index 33b5f1974..1d42519d3 100644 --- a/website/docs/getting-started/updating.md +++ b/website/docs/getting-started/updating.md @@ -171,7 +171,9 @@ If you installed manually (not via the quick installer): ```bash cd /path/to/hermes-agent -export VIRTUAL_ENV="$(pwd)/venv" +# Activate the venv you created during install (outside the source tree) +export VIRTUAL_ENV="$HOME/.hermes/venvs/hermes-dev" +export PATH="$VIRTUAL_ENV/bin:$PATH" # Pull latest code git pull origin main