Repository navigation
Closed as not planned
Labels
P3Low — cosmetic, nice to haveLow — cosmetic, nice to havecomp/agentCore agent runtime: loop, agent_init, prompt builder, context-compression, responses endpointCore agent runtime: loop, agent_init, prompt builder, context-compression, responses endpointcomp/cliCLI entry point, hermes_cli/, setup wizardCLI entry point, hermes_cli/, setup wizardsweeper:implemented-on-mainSweeper: behavior already present on current mainSweeper: behavior already present on current maintype/bugSomething isn't workingSomething isn't working
Description
Bug Description
Hermes Agent crashes immediately on Python 3.9 with TypeError: unsupported operand type(s) for |: 'type' and 'NoneType'
Steps to Reproduce
- Use Python 3.9 (or < 3.10)
- Run
hermes --versionor any hermes command - Observe crash
Error Output
Traceback (most recent call last):
File "/path/to/hermes-agent/hermes", line 10, in <module>
from hermes_cli.main import main
File "/path/to/hermes-agent/hermes_cli/main.py", line 6452, in <module>
env: dict[str, str] | None = None,
TypeError: unsupported operand type(s) for |: 'types.GenericAlias' and 'NoneType'
Root Cause
Multiple files use Python 3.10+ type hint syntax (X | None, dict[str, str] | None) without:
- Adding
from __future__ import annotationsto make it a string annotation (forward-compatible) - Or checking Python version >= 3.10 in the launcher
Affected files include:
hermes_constants.pyutils.pyhermes_cli/main.py- Many plugin/model provider files (shown in "Failed to load bundled provider plugin" warnings)
Suggested Fix
- Add
from __future__ import annotationsto ALL Python files that use|type syntax - OR add Python version check in
hermeslauncher script:
import sys
if sys.version_info < (3, 10):
raise RuntimeError("Hermes Agent requires Python 3.10 or higher")Environment
- OS: macOS (LibreSSL 2.8.3)
- Python: 3.9.x (system) or 3.11.x (venv)
- Hermes Agent: v0.13.0 (2026.5.7)
Workaround
Use Python 3.11+ via venv, or fix shebang to point to correct Python binary.
Reacted by Jaherhum
Metadata
Metadata
Assignees
Labels
P3Low — cosmetic, nice to haveLow — cosmetic, nice to havecomp/agentCore agent runtime: loop, agent_init, prompt builder, context-compression, responses endpointCore agent runtime: loop, agent_init, prompt builder, context-compression, responses endpointcomp/cliCLI entry point, hermes_cli/, setup wizardCLI entry point, hermes_cli/, setup wizardsweeper:implemented-on-mainSweeper: behavior already present on current mainSweeper: behavior already present on current maintype/bugSomething isn't workingSomething isn't working
Activity
alt-glitch commentedon May 8, 2026
Related: PR #13765 adds
from __future__ import annotationsto 112 files for Python 3.9 PEP 604 compatibility. Also related to #16257 and PR #15158 which fix the same class of bug in specific files.\n\nWorkaround: use Python 3.10+ (recommended) or wait for #13765 to land.mtthw-prvs-mngd commentedon May 19, 2026
Confirming this still reproduces on v0.14.0 (2026.5.16) with a fresh install on macOS (Apple Silicon, Sonoma 14.x). Same trace as the OP, slightly different line:
Concrete root cause on macOS specifically:
The installer drops a launcher at
~/.hermes/hermes-agent/hermeswith shebang#!/usr/bin/env python3. On macOS,/usr/bin/env python3resolves to the system Python at/usr/bin/python3which Apple has shipped as 3.9.6 since macOS 12 — still the default on Sonoma 14 / Sequoia 15. The installer itself usesuvto build a venv with Python 3.11.15 at~/.hermes/hermes-agent/venv/bin/python, so the right Python is right there — the launcher just doesn't use it.Workaround that's been reliable across v0.13.0 and v0.14.0:
The venv binary's auto-generated shebang correctly points at the venv Python (it's
pip install-created), so invoking it directly bypasses the broken top-level launcher.Suggested fix (smallest possible change):
Change the launcher's shebang from
#!/usr/bin/env python3to either:#!/Users/${USER}/.hermes/hermes-agent/venv/bin/python— installer-templated, would need substitution at install time but is correct-by-construction"$(dirname "$0")/venv/bin/python" "$(dirname "$0")/hermes.py" "$@"— no install-time templating neededOption 2 is what most installers in this position do (uv itself ships entry-point shims that work this way). It also survives
$HOMEmoves and multi-user installs without re-running the installer.The version-check approach the OP suggested is fine as a defensive fallback, but it'd give users a "your Python is too old" error when they actually have a correct Python sitting 12 inches away in the bundled venv — which feels like the wrong UX.
Happy to send a PR if you'd like — let me know if option 2 is the direction or if you'd prefer the version-check + clearer error message.
teknium1 commentedon Jul 13, 2026
Thanks for the detailed macOS reproduction and for identifying that the bundled venv was not being used.
Automated hermes-sweeper review found this addressed on current main:
scripts/install.sh:1603-1644now writes the user-facinghermeslauncher as a Bash shim that execs$INSTALL_DIR/venv/bin/hermes, so it does not invoke/usr/bin/env python3.scripts/install.sh:59andscripts/install.sh:1322-1343provision and pin the managed venv to Python 3.11.pyproject.toml:20now declares Python 3.11–3.13 support, andwebsite/docs/reference/faq.md:147-160documents that requirement.v2026.7.1(commitd682f320b35a13084371a541a835e1d988c982b8).The related unmerged PR #22366 proposed an import-time version error; the current installer instead fixes the reported standard-install path by consistently dispatching through the managed venv.