Skip to content

feat(gateway/stt): reply to voice messages with transcription text - #25679

Closed
Quarkex wants to merge 1 commit into
NousResearch:mainfrom
Quarkex:feat/stt-reply-transcript
Closed

feat(gateway/stt): reply to voice messages with transcription text#25679
Quarkex wants to merge 1 commit into
NousResearch:mainfrom
Quarkex:feat/stt-reply-transcript

Conversation

@Quarkex

@Quarkex Quarkex commented May 14, 2026

Copy link
Copy Markdown
Contributor

Summary

Add an opt-in stt_reply_transcript config option that replies to voice messages with their transcription text, making voice content searchable and quotable in chat history.

Motivation

Voice messages in messaging platforms are opaque — you can't search them, quote them, or skim them. When STT is already transcribing for the agent, surfacing that transcription as a visible reply costs nothing extra and significantly improves UX for users who rely heavily on voice input.

Configuration

stt:
  reply_transcript: true  # default: false

Or flat: stt_reply_transcript: true

Implementation

  • gateway/config.py: New stt_reply_transcript field with from_dict/to_dict support (accepts both nested stt.reply_transcript and flat key)
  • gateway/run.py:
    • Extended _enrich_message_with_transcription signature to accept platform/chat_id/message_id/thread_id
    • New _send_reply_transcript helper — fire-and-forget, calls the platform adapter's send_message with reply_to_message_id
  • tests/gateway/test_stt_reply_transcript.py: Config parsing tests (5 cases)

Design decisions

  • Opt-in — disabled by default, zero behavior change for existing users
  • Fire-and-forget — reply delivery failures are logged at DEBUG, never block message processing
  • Not injected into agent transcript — the reply is purely a UX convenience; the agent sees only the normal [The user sent a voice message~] envelope
  • Platform-agnostic — works with any adapter that implements send_message(reply_to_message_id=...)
  • Reply format: 🎤 «transcribed text» — visually distinct, not confused with agent responses

Testing

  • All existing STT tests pass (test_stt_config.py: 5/5)
  • New test file: 5/5 pass
  • Manually tested on Telegram (voice → reply appears instantly)

@alt-glitch alt-glitch added type/feature New feature or request P3 Low — cosmetic, nice to have comp/gateway Gateway runner, session dispatch, delivery tool/tts Text-to-speech and transcription duplicate This issue or pull request already exists labels May 14, 2026
@alt-glitch

Copy link
Copy Markdown
Collaborator

Duplicate of #13727. This is the fourth independent implementation of STT transcript echo (after #13727, #22123, and #25196). The canonical PR is #13727 which adds stt.send_transcription config key.

@Quarkex
Quarkex force-pushed the feat/stt-reply-transcript branch from 8e4321d to ba3ce00 Compare May 14, 2026 15:06
Add opt-in stt_reply_transcript config option (default: false).
When enabled, the gateway replies to voice messages with their
transcription as a quoted reply (🎤 «text»), making voice content
searchable and quotable in chat history.

Config:
  stt:
    reply_transcript: true   # or stt_reply_transcript: true (flat)

Implementation:
- GatewayConfig: new field + from_dict/to_dict support
- _enrich_message_with_transcription: extended signature to accept
  platform/chat_id/message_id/thread_id for reply delivery
- _send_reply_transcript: fire-and-forget helper that calls the
  platform adapter's send_message with reply_to_message_id

The reply is never injected into the agent's transcript — it's purely
a UX convenience for users who want to search voice content later.
@Quarkex
Quarkex force-pushed the feat/stt-reply-transcript branch from ba3ce00 to fca5e64 Compare May 14, 2026 15:07
@teknium1

Copy link
Copy Markdown
Contributor

This is an automated hermes-sweeper review: the configurable STT transcript echo requested here is already implemented on current main.

  • gateway/run.py:10435-10456 transcribes inbound audio and sends each successful 🎙️ transcript through the source platform adapter.
  • gateway/config.py:689, 861-867, and 924 provide the canonical stt.echo_transcripts configuration gate; tests/gateway/test_stt_transcript_echo_config.py:8-70 covers its behavior and all echo send sites.
  • gateway/run.py:15203-15224, 19180-19197, and 19602-19618 cover queued and active-run voice-message paths as well.
  • The implementation shipped in bfc5262725a3a12b0f1c6d4b9e051d27ef4ceede (feat: add STT transcript echo toggle), included in v2026.7.7.

The duplicate discussion linking #13727 was useful context; that PR's maintainer follow-up also confirms that transcript echo is now on main. Thanks for the contribution.

@teknium1 teknium1 closed this Jul 13, 2026
@teknium1 teknium1 added the sweeper:implemented-on-main Sweeper: behavior already present on current main label Jul 13, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

comp/gateway Gateway runner, session dispatch, delivery duplicate This issue or pull request already exists P3 Low — cosmetic, nice to have sweeper:implemented-on-main Sweeper: behavior already present on current main 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