Skip to content

fix(gateway): serialize STT/TTS reliability slice behind V6 contract - #78196

Open
andrexibiza wants to merge 3 commits into
NousResearch:mainfrom
andrexibiza:vox/07-gateway-routing
Open

fix(gateway): serialize STT/TTS reliability slice behind V6 contract#78196
andrexibiza wants to merge 3 commits into
NousResearch:mainfrom
andrexibiza:vox/07-gateway-routing

Conversation

@andrexibiza

@andrexibiza andrexibiza commented Aug 4, 2026

Copy link
Copy Markdown
Contributor

Current disposition — candidate_blocked (Discord V6)

Canonical campaign authority: #90321, validated by the generic ledger contract in #90307.

Exact current head: 8e5cf6e57ca547da5a7b79a445cf5b66c426d9e0.

This branch contains real STT/TTS reliability fixes, but it is not the complete V6 publication authority by itself. V6 remains a paired/collision gap: open #78180 changes adjacent Discord voice config, persistence, command, gateway/run.py, and adapter surfaces. The campaign needs an explicit addendum and serialized composition rather than merging two locally coherent voice trains and discovering the contract afterward.

What this branch proves

1. Bounded stalled transcription

Salvaged from #74051, authored by @mglavinic86:

  • wraps the complete configured-provider plus local-fallback sequence in a gateway-level deadline;
  • defaults stt_timeout_seconds to 45 seconds;
  • fails open with an audio-path marker instead of pinning the chat lock forever.

2. Media-producer recovery and delivery visibility

Residual work from #65745, authored by @dhansxd:

  • recovers producer identity from explicit tool-result tool_name / name fields when the paired assistant tool_calls row is absent;
  • restores automatic delivery eligibility for reconstructed/persisted TTS/audio results;
  • logs unsuccessful voice-reply SendResult values instead of silently discarding the failure.

Historical focused verification reported 61 passing tests on Windows plus clean diff/footgun checks. That evidence remains useful for this head; it is not exact-current-main acceptance.

V6 collision / contract gap

#78180 independently introduces per-chat transcribe-only mode, transcript destinations, persisted voice preferences, slash-command behavior, and additional STT drop-point logging. It touches the same broad voice-control surfaces while representing different product semantics.

Before either train is promoted as V6 completion, the paired addendum must decide:

  • which behaviors are one capability versus separately reviewable slices;
  • config and persistence ownership;
  • handler/command sequencing and compatibility;
  • attribution and merge order;
  • exact negative behavior for stalled STT, passive transcription, file-only transcripts, media delivery, and disabled agent turns.

Required before merge

  1. Publish the V6 paired addendum that serializes fix(gateway): serialize STT/TTS reliability slice behind V6 contract #78196 and feat(gateway): Discord VC transcribe-only mode and transcript file destination #78180 without collapsing distinct behaviors into one unreviewable train.
  2. Preserve @mglavinic86 and @dhansxd provenance on the salvaged fixes.
  3. Rebase the selected slice onto current main and resolve overlapping voice config/handler/persistence ownership deliberately.
  4. Run exact-head STT timeout, transcript-mode, TTS/media routing, busy-session, voice-command, persistence, and cross-platform tests.
  5. Reconcile the authoritative publication state in docs(discord): install canonical 42-row parity ledger #90321 only after the composed contract is real.

Historical relationships

This PR is implementation evidence pending V6 composition. It is ready for review, but not merge-authorized until the paired V6 contract above is satisfied.

mglavinic86 and others added 2 commits August 4, 2026 00:10
Prevents a stalled gateway speech-to-text call from holding a messaging
chat indefinitely. Gateway voice transcription runs synchronous provider
work through asyncio.to_thread(); provider HTTP/process timeouts do not
cover hangs in setup, local fallback, filesystem access, or cleanup, so
one stuck call can block the chat lock and every later message in that
conversation.

Adds a configurable gateway-level deadline (stt_timeout_seconds, default
45s; stt.gateway_timeout_seconds in config.yaml) around the complete
configured-provider + local-fallback sequence. On timeout, Hermes logs
the failure, keeps the existing audio-path marker, and continues
fail-open so the agent can respond instead of leaving the chat wedged.

Salvaged from NousResearch#74051, authored by @mglavinic86.

Signed-off-by: andrexibiza <84248988+andrexibiza@users.noreply.github.com>
Salvaged residual gaps from NousResearch#65745 (authored by @dhansxd) that are not
already covered on main:

- Recover allowed media producers from explicit tool-result tool_name /
  name when the paired assistant tool_calls row is absent. Persisted or
  reconstructed tool results that lost that row previously fell out of
  the automatic-delivery allowlist, so their TTS/audio MEDIA tags were
  silently dropped instead of delivered.
- Log unsuccessful auto voice-reply SendResult values instead of
  silently ignoring them, so delivery failures are diagnosable.

The other NousResearch#65745 changes (drop silent transcripts before invoking the
agent, transcribe voice follow-ups before busy-session handling) are
already covered on main by NousResearch#41603's empty-transcript sentinel and the
pending-STT cache, so they are intentionally not re-applied.

Co-Authored-By: Dani Ubaidillah Husain <daniubaidillahhusain@gmail.com>
Signed-off-by: andrexibiza <84248988+andrexibiza@users.noreply.github.com>
…ribution

Maps the author emails of the two salvaged gateway voice commits (from
NousResearch#74051 @mglavinic86 and NousResearch#65745 @dhansxd) so the check-attribution CI
gate can resolve them to their GitHub identities.

Signed-off-by: andrexibiza <84248988+andrexibiza@users.noreply.github.com>
@alt-glitch alt-glitch added type/bug Something isn't working comp/gateway Gateway runner, session dispatch, delivery tool/tts Text-to-speech and transcription area/config Config system, migrations, profiles sweeper:risk-message-delivery Sweeper risk: may drop, duplicate, misroute, or suppress messages sweeper:risk-compatibility Sweeper risk: may break existing users, config, migrations, defaults, or upgrades P2 Medium — degraded but workaround exists labels Aug 4, 2026
@andrexibiza andrexibiza changed the title fix(gateway): fail open on stalled voice transcription; recover media producers + log voice delivery failures WIP(gateway): serialize STT/TTS reliability slice behind V6 contract Aug 20, 2026
@andrexibiza
andrexibiza marked this pull request as draft August 20, 2026 15:14
@andrexibiza
andrexibiza marked this pull request as ready for review August 21, 2026 01:35
@andrexibiza andrexibiza changed the title WIP(gateway): serialize STT/TTS reliability slice behind V6 contract fix(gateway): serialize STT/TTS reliability slice behind V6 contract Aug 21, 2026

Copy link
Copy Markdown
Contributor Author

V6 paired-contract interlock published in #91913

The authority-continuity manifest records this PR together with #78180 and deliberately assigns no independent V6 delivery owner yet.

This lane owns bounded transcription settlement, fail-open audio preservation, media-producer recovery, and delivery visibility inside the shared voice-turn state machine. It must consume the same agent-turn admission decision as #78180; timeout/fallback and media recovery cannot manufacture or bypass an agent turn.

Contract PR: #91913
Exact contract head: 170a3a0e67034abd7d6a2c69a16c292b4781720f.

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 P2 Medium — degraded but workaround exists sweeper:risk-compatibility Sweeper risk: may break existing users, config, migrations, defaults, or upgrades sweeper:risk-message-delivery Sweeper risk: may drop, duplicate, misroute, or suppress messages tool/tts Text-to-speech and transcription type/bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants