hermes-agent/hermes_cli
Teknium 07927f6bf2
feat(stt): add free local whisper transcription via faster-whisper (#1185)
* fix: Home Assistant event filtering now closed by default

Previously, when no watch_domains or watch_entities were configured,
ALL state_changed events passed through to the agent, causing users
to be flooded with notifications for every HA entity change.

Now events are dropped by default unless the user explicitly configures:
- watch_domains: list of domains to monitor (e.g. climate, light)
- watch_entities: list of specific entity IDs to monitor
- watch_all: true (new option — opt-in to receive all events)

A warning is logged at connect time if no filters are configured,
guiding users to set up their HA platform config.

All 49 gateway HA tests + 52 HA tool tests pass.

* docs: update Home Assistant integration documentation

- homeassistant.md: Fix event filtering docs to reflect closed-by-default
  behavior. Add watch_all option. Replace Python dict config example with
  YAML. Fix defaults table (was incorrectly showing 'all'). Add required
  configuration warning admonition.
- environment-variables.md: Add HASS_TOKEN and HASS_URL to Messaging section.
- messaging/index.md: Add Home Assistant to description, architecture
  diagram, platform toolsets table, and Next Steps links.

* fix(terminal): strip provider env vars from background and PTY subprocesses

Extends the env var blocklist from #1157 to also cover the two remaining
leaky paths in process_registry.py:

- spawn_local() PTY path (line 156)
- spawn_local() background Popen path (line 197)

Both were still using raw os.environ, leaking provider vars to background
processes and interactive PTY sessions. Now uses the same dynamic
_HERMES_PROVIDER_ENV_BLOCKLIST from local.py.

Explicit env_vars passed to spawn_local() still override the blocklist,
matching the existing behavior for callers that intentionally need these.

Gap identified by PR #1004 (@PeterFile).

* feat(delegate): add observability metadata to subagent results

Enrich delegate_task results with metadata from the child AIAgent:

- model: which model the child used
- exit_reason: completed | interrupted | max_iterations
- tokens.input / tokens.output: token counts
- tool_trace: per-tool-call trace with byte sizes and ok/error status

Tool trace uses tool_call_id matching to correctly pair parallel tool
calls with their results, with a fallback for messages without IDs.

Cherry-picked from PR #872 by @omerkaz, with fixes:
- Fixed parallel tool call trace pairing (was always updating last entry)
- Removed redundant 'iterations' field (identical to existing 'api_calls')
- Added test for parallel tool call trace correctness

Co-authored-by: omerkaz <omerkaz@users.noreply.github.com>

* feat(stt): add free local whisper transcription via faster-whisper

Replace OpenAI-only STT with a dual-provider system mirroring the TTS
architecture (Edge TTS free / ElevenLabs paid):

  STT: faster-whisper local (free, default) / OpenAI Whisper API (paid)

Changes:
- tools/transcription_tools.py: Full rewrite with provider dispatch,
  config loading, local faster-whisper backend, and OpenAI API backend.
  Auto-downloads model (~150MB for 'base') on first voice message.
  Singleton model instance reused across calls.
- pyproject.toml: Add faster-whisper>=1.0.0 as core dependency
- hermes_cli/config.py: Expand stt config to match TTS pattern with
  provider selection and per-provider model settings
- agent/context_compressor.py: Fix .strip() crash when LLM returns
  non-string content (dict from llama.cpp, None). Fixes #1100 partially.
- tests/: 23 new tests for STT providers + 2 for compressor fix
- docs/: Updated Voice & TTS page with STT provider table, model sizes,
  config examples, and fallback behavior

Fallback behavior:
- Local not installed → OpenAI API (if key set)
- OpenAI key not set → local whisper (if installed)
- Neither → graceful error message to user

Co-authored-by: Jah-yee <Jah-yee@users.noreply.github.com>

---------

Co-authored-by: omerkaz <omerkaz@users.noreply.github.com>
Co-authored-by: Jah-yee <Jah-yee@users.noreply.github.com>
2026-03-13 11:11:05 -07:00
..
__init__.py chore: bump version to v0.2.0 + add curated first-release changelog 2026-03-12 01:52:53 -07:00
auth.py fix: prevent model/provider mismatch when switching providers during active gateway (#1183) 2026-03-13 09:03:48 -07:00
banner.py feat: add versioning infrastructure and release script 2026-03-12 01:35:47 -07:00
callbacks.py feat: secure skill env setup on load (core #688) 2026-03-13 03:14:04 -07:00
checklist.py fix: skip hanging tests + add global test timeout 2026-03-12 01:23:28 -07:00
claw.py feat: add 'hermes claw migrate' command + migration docs 2026-03-12 08:20:12 -07:00
clipboard.py fix: clean up empty file after failed wl-paste clipboard extraction 2026-03-11 02:56:19 -07:00
codex_models.py fix: unify visibility filter in codex model discovery 2026-03-10 15:15:33 +03:00
colors.py Cleanup time! 2026-02-20 23:23:32 -08:00
commands.py feat(cli): add /reasoning command for effort level and display toggle 2026-03-11 06:02:18 -07:00
config.py feat(stt): add free local whisper transcription via faster-whisper (#1185) 2026-03-13 11:11:05 -07:00
cron.py refactor: streamline cron job handling and update CLI commands 2026-02-21 16:21:19 -08:00
curses_ui.py refactor: extract shared curses checklist, fix skill discovery perf 2026-03-11 03:06:15 -07:00
doctor.py fix: report cronjob tool as available in hermes doctor 2026-03-13 08:51:45 -07:00
gateway.py fix: strip user: prefix from Discord allowed user IDs in onboarding 2026-03-13 09:35:46 -07:00
main.py fix: separate Anthropic OAuth tokens from API keys 2026-03-13 02:09:52 -07:00
models.py fix: Anthropic OAuth — beta header, token refresh, config contamination, reauthentication (#1132) 2026-03-12 20:45:50 -07:00
pairing.py Cleanup time! 2026-02-20 23:23:32 -08:00
runtime_provider.py fix: separate Anthropic OAuth tokens from API keys 2026-03-13 02:09:52 -07:00
setup.py fix: strip user: prefix from Discord allowed user IDs in onboarding 2026-03-13 09:35:46 -07:00
skills_config.py fix: wire email platform into toolset mappings + add documentation 2026-03-11 06:34:32 -07:00
skills_hub.py chore(skills): clean up PR #862 — simplify manifest guard, DRY up tests 2026-03-12 08:08:22 -07:00
skin_engine.py fix: add themed hero art for all skins, fix triple-quote syntax 2026-03-10 03:54:12 -07:00
status.py fix: separate Anthropic OAuth tokens from API keys 2026-03-13 02:09:52 -07:00
tools_config.py fix: wire email platform into toolset mappings + add documentation 2026-03-11 06:34:32 -07:00
uninstall.py Cleanup time! 2026-02-20 23:23:32 -08:00