Skip to content

feat(gateway): echo voice-message transcripts back to the user - #13727

Closed
briancaffey wants to merge 1 commit into
NousResearch:mainfrom
briancaffey:feat/stt-send-transcription
Closed

feat(gateway): echo voice-message transcripts back to the user#13727
briancaffey wants to merge 1 commit into
NousResearch:mainfrom
briancaffey:feat/stt-send-transcription

Conversation

@briancaffey

Copy link
Copy Markdown

Summary

Opt-in gateway behavior that echoes the transcript of an incoming voice message back to the user as its own chat message before the agent replies. Useful for verifying STT accuracy on technical terms, names, and instructions on messaging platforms (Telegram, Discord, Slack, etc.).

The echo is off by default and controlled by two new keys under stt: in config.yaml:

  • send_transcription (bool, default false) — enable/disable the echo
  • send_transcription_header (string, default "") — optional prefix, e.g. "🎤 **Voice Transcription**\n\n"

A new gateway slash command toggles the echo at runtime and persists the change to config.yaml (same pattern as /verbose):

  • /stt or /stt status — show current STT state
  • /stt echo — toggle on/off
  • /stt echo on|off — set explicitly
  • /stt echo status — show just the echo state

Echo send failures are swallowed with a warning; the agent still replies normally with the transcript in context.

Test plan

  • pytest tests/gateway/test_stt_command.py tests/gateway/test_stt_config.py -v — 31 tests covering config load, the echo path in _enrich_message_with_transcription, every form of /stt, toggle/status/unknown-subcommand paths, and that sibling stt.* keys are preserved on save
  • Manual: set stt.send_transcription: true in ~/.hermes/config.yaml, send a voice message via Telegram — confirm transcript echoes before the agent replies
  • Manual: run /stt to view status, /stt echo off to disable, verify config.yaml shows stt.send_transcription: false, send another voice message and confirm no echo
  • Manual: restart the gateway and confirm the toggled value persists

Files touched

  • gateway/config.py — two new GatewayConfig fields loaded from the nested stt: block
  • gateway/run.py — echo in _enrich_message_with_transcription, new _echo_transcription helper, new _handle_stt_command + dispatch case
  • hermes_cli/commands.py/stt registered in COMMAND_REGISTRY
  • cli-config.yaml.example, website/docs/user-guide/configuration.md — docs + example config
  • tests/gateway/test_stt_command.py, tests/gateway/test_stt_config.py — test coverage

🤖 Generated with Claude Code

Adds an opt-in gateway behavior that sends the transcript of an incoming
voice message as its own chat message before the agent replies, with an
optional header prefix. Useful for verifying STT accuracy on technical
terms, names, and instructions.

Config (stt block in ~/.hermes/config.yaml):
  - send_transcription (bool, default false) — enable the echo
  - send_transcription_header (string, default "") — optional prefix

Toggled at runtime via a new gateway slash command:
  /stt                   → show STT status
  /stt echo              → toggle echo on/off
  /stt echo on|off       → set explicitly
  /stt echo status       → show just the echo state

The /stt handler updates self.config in memory AND persists the change
to config.yaml via atomic_yaml_write, matching the /verbose pattern so
restarts keep the new value.

Echo send failures are swallowed with a warning — the agent still
replies normally with the transcript in context.
@teknium1

teknium1 commented Jul 5, 2026

Copy link
Copy Markdown
Contributor

The core of this PR is now implemented on main: voice-message transcripts are echoed back to the user (🎙️ format) at every gateway path, and as of PR #58859 the echo is configurable via stt.echo_transcripts in config.yaml (default on). Your PR was the earliest proposal of transcript echoing — thanks for pioneering the idea.

The one piece that didn't land is the /stt runtime slash command for toggling at runtime. If that's still useful to you, a focused resubmit adding just the slash command on top of the current stt.echo_transcripts key would be welcome.

@teknium1 teknium1 closed this Jul 5, 2026
@briancaffey

Copy link
Copy Markdown
Author

Awesome, thank you @teknium1 for letting me know!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area/config Config system, migrations, profiles comp/gateway Gateway runner, session dispatch, delivery tool/tts Text-to-speech and transcription type/feature New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants