hermes-agent/hermes_cli
teknium1 2c7deb41f6 Fix Modal backend not working from CLI
Two config systems used different key names for the terminal backend:
- hermes_cli/config.py, README, and all docs use "terminal.backend"
- cli.py's env var mapping only recognized "terminal.env_type"

Users following the docs who set `backend: modal` in ~/.hermes/config.yaml
had it silently ignored -- TERMINAL_ENV always defaulted to "local".

Additionally, when no config file existed, cli.py's hardcoded defaults
overwrote any TERMINAL_ENV=modal set in .env, despite the comment saying
"env vars take precedence."

Fixes:
- cli.py now normalizes "backend" -> "env_type" (backend takes precedence)
- Defaults no longer overwrite .env when no config file terminal section exists
- hermes status reads from config as fallback when env var isn't set

Also fixes four related bugs found in the Modal/sandbox lifecycle:
- file_tools cache not cleared on sandbox cleanup (stale ops on dead sandbox)
- Global lock held during slow Modal teardown (blocked all tool calls 10-15s)
- Race condition in file_tools between existence check and access (KeyError)
- Per-task creation locks never cleaned up (memory leak)
2026-02-16 19:47:23 -08:00
..
__init__.py Enhance CLI with multi-platform messaging integration and configuration management 2026-02-02 19:01:51 -08:00
config.py Refactor configuration handling to improve user experience 2026-02-16 00:33:45 -08:00
cron.py Enhance CLI with multi-platform messaging integration and configuration management 2026-02-02 19:01:51 -08:00
doctor.py Remove browserbase SDK check and add Node.js and agent-browser validation in doctor script 2026-02-16 02:41:24 -08:00
gateway.py Fix gateway exit code to enable systemd auto-restart on connection failure 2026-02-10 16:01:00 -08:00
main.py Add messaging platform enhancements: STT, stickers, Discord UX, Slack, pairing, hooks 2026-02-15 21:38:59 -08:00
pairing.py Add messaging platform enhancements: STT, stickers, Discord UX, Slack, pairing, hooks 2026-02-15 21:38:59 -08:00
setup.py Add Text-to-Speech (TTS) functionality with multiple providers 2026-02-12 10:05:08 -08:00
status.py Fix Modal backend not working from CLI 2026-02-16 19:47:23 -08:00
uninstall.py Add uninstall command to CLI and update documentation 2026-02-02 22:18:18 -08:00