Skip to content

bug(voice): Fish Audio voice regression — Eva replies in generic English to Spanish Telegram voice input (mirror of toryx-private#797) #1

@lmsanch

Description

@lmsanch

Mirror of lmsanch/toryx-private#797

Production runtime for this fix is ~/.hermes/hermes-agent/ on spark-8a52 = this repo. A prior agent patched services/virtual_team/ on toryx-private by mistake — that tree is dev scaffolding for The Desk (NousResearch#552 / NousResearch#676 on toryx-private), not the live voice pipeline.

Symptoms

  • Luis asks Eva in Spanish via Telegram voice message
  • Eva replies in a generic English voice (Fish Audio fallback), not her Fish Audio voice_id
  • Cross-agent consult_colleague calls also reported broken in the same incident

Three fixes to port from lmsanch/toryx-private's commit a4c045bf

The prior commit patched dead code on toryx-private but the LOGIC is right. Port to this repo's actual voice-reply path (located in gateway/ / tools/).

  1. Voice brevity prefix must not hardcode English.

    • Find the equivalent of _VOICE_BREVITY_PREFIX in this repo (note: that exact symbol doesn't exist — start with grep -rnE "brevity|voice prefix|conversational" gateway/ tools/).
    • Replace the English-only wording with an explicit language-mirror directive so each SOUL's [RESPOND IN: <lang>] isn't overridden.
  2. Reject empty voice_id at submit-time rather than silently passing it to Fish Audio.

    • Find the Fish Audio TTS invocation. If voice_id is empty, raise rather than proceed.
    • Log ERROR (not silent) when a profile has no fish_voice_id, so regression is visible at daemon start.
  3. Deterministic [RESPOND IN: <lang>] injection per config/org_chart.md §3.3 (in toryx-private) — locate the prompt-composition path that builds the user turn for the LLM and inject a language directive based on detection.

    • Heuristic first: Spanish diacritics + function words (fast, deterministic).
    • Fallback: langdetect (noisy on short strings — scope to ES-only v1).
    • Env flag HERMES_LANG_HINT_ENABLED (default true) to disable without a code change.

Smoke test

Send Eva a Spanish voice message from Telegram → she should reply in her own Fish Audio voice in Spanish. Logs should show a [RESPOND IN: ES] injection.

Tests

Port tests/unit/test_multi_bot_voice.py from toryx-private's a4c045bf to this repo's test location.

Don't touch

Parent issue (toryx-private)

lmsanch/toryx-private#797 — that tracks the user-visible regression; this repo has the actual fix.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions