Hermes Update Pipeline Breakdown | Generated by AI

Home 2026.05

Now I have a thorough understanding. Here’s the full breakdown:


How hermes update works – it’s more sophisticated than it looks.

The entire flow lives in hermes_cli/main.py, primarily _cmd_update_impl() (line 7737). Here’s the pipeline, step by step:

1. Hangup Protection (_install_hangup_protection, line 7317)

Before anything else, it installs SIGHUP=SIG_IGN and wraps stdout/stderr to mirror to ~/.hermes/logs/update.log. This prevents SSH disconnects from killing a mid-update pip install, leaving the venv half-broken. SIGINT (Ctrl-C) and SIGTERM are intentionally left alone – those are legitimate cancellations.

2. Pre-update Backup (_run_pre_update_backup, line 7590)

Gated on updates.pre_update_backup config (default off). Can be forced with --backup flag. Creates a full zip snapshot of HERMES_HOME. Off by default because large installs make the zip take minutes.

3. Install Method Detection (line 7760)

Three paths:

4. Fork Detection (_is_fork, line 6604)

Compares the origin remote URL against OFFICIAL_REPO_URLS (the NousResearch/hermes-agent repo). If it doesn’t match, you’re on a fork – it prints a warning and enables upstream sync logic later.

5. Git Update (line 7811)

6. Git Pull (line 7927)

7. Bytecode Cache Cleanup (_clear_bytecode_cache, line 5647)

Recursively removes __pycache__/ directories. Prevents ImportError when updated source references names that didn’t exist in the old compiled .pyc files. This is the “Cleared 63 stale pycache directories” you saw.

8. Fork Upstream Sync (_sync_with_upstream_if_needed, line 6699)

Only for forks. The clever bit:

9. Python Dependencies (line 7994)

10. Lazy Backend Refresh (_refresh_active_lazy_features, line 7006)

Most optional backends (providers, platforms, etc.) are “lazy deps” – installed on first use, not in pyproject.toml’s [all]. The problem: uv pip install -e .[all] doesn’t touch already-installed lazy deps, so if a lazy dep pin is bumped (CVE, bug fix), users keep the stale version forever. This step finds which lazy features the user has previously activated and reinstalls them under current pins. This is the “Refreshing 22 active lazy backend(s)… 14 refreshed” you saw.

11. Node.js Dependencies (_update_node_dependencies, line 7212)

Runs npm install in the TUI directory (ui-tui/) if package.json exists.

12. Skills Sync (line 8059)

Copies new bundled skills to ~/.hermes/skills/, updates changed ones, but respects user modifications (won’t overwrite a user-edited skill). Then syncs to all profiles.

13. Config Migration (line 8131)

Checks for missing env vars, new config fields, and config version bumps. Offers interactive migration (or auto-migration in non-interactive/gateway mode). This ensures new features that need config keys get them.

14. Gateway Auto-Restart (line 8275)

If running in gateway mode (--gateway), after the code update:

What makes it innovative:


Back Donate