fix(stt): better error logging and smarter DM when STT lazy-install fails#46127
Open
damiankluk wants to merge 4 commits into
Open
fix(stt): better error logging and smarter DM when STT lazy-install fails#46127damiankluk wants to merge 4 commits into
damiankluk wants to merge 4 commits into
Conversation
tonydwb
approved these changes
Jun 15, 2026
tonydwb
left a comment
There was a problem hiding this comment.
Code Review Summary
Verdict: Approved
Improves STT lazy-install failure logging and adds smarter DM message when STT fails to install.
Looks Good
- Better error context for debugging STT installation failures.
- Cleaner user-facing messaging for install failures.
- Well-scoped change.
Reviewed by Hermes Agent
Three improvements to the voice-transcription setup flow: 1. tools/transcription_tools.py - Log lazy-install failures at WARNING instead of DEBUG, and include actionable guidance about venv permission issues (the most common cause of silent STT failures). 2. gateway/run.py - Smart DM message: check the actual stt config before sending setup instructions. If stt.enabled is already true and provider is 'local', skip the redundant 'set stt.enabled' advice and show a permission-aware install hint instead. 3. gateway/run.py - Agent note now includes a config-aware hint about why STT is unavailable (e.g. 'provider is local but faster-whisper failed to install').
kill -0 returns success on zombie processes (the PID still occupies the process table), causing the restart watcher to loop forever. Check /proc/PID/status for State:Z and bail out early. Also cap the wait at 120 s (600 * 0.2s) as a safety net. Fixes the /restart command hanging on Telegram when the old gateway becomes a zombie because the dashboard (PID 1) doesn't reap children.
… workflow_dispatch
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
When a user sends a voice message and faster-whisper is not installed, the gateway:
uv pip installset stt.enabled: trueeven when it is alreadytrueChanges
tools/transcription_tools.py_try_lazy_install_stt(): Log failures at WARNING instead of DEBUG, with the actual exception message and actionable guidance for the most common cause — the Hermes process user cannot write to the virtual environment (UID mismatch in Docker/user-namespace setups).gateway/run.py— STT failure DM (sent to user)stt.enabled: false→ says so specificallystt.provider: localor auto-detected → shows a permission-aware install commandgateway/run.py— Agent context noteRoot cause investigated
In the reporters environment (Docker with user-namespace mapping), the gateway process runs as
uid=1000but the Hermes venv (/opt/hermes/.venv/) is owned byuid=10000. All lazy-installs fail silently becauseuv pip installcannot write to the venv. The.envfile now includesPYTHONPATH=/home/hermes/.hermes/venv_extpointing to a writable extension directory where faster-whisper has been pre-installed.Testing
PYTHONPATHincludes the extension directory