fix: play returned TTS audio path in CLI voice mode - #43131
Conversation
Add current email to AUTHOR_MAP and remove a stale duplicate self-entry. Fixes check-attribution failure for this PR.
9478d2d to
4df1f53
Compare
|
Thanks for tracing the returned-path contract; the underlying issue is present on current main in both callers. Problems
Suggested changes
This is an automated hermes-sweeper review. |
|
Thanks for catching this. Updated in Both CLI playback paths now prefer the requested MP3 only when it exists and is non-empty, and fall back to the This preserves returned-path playback for providers that produce only an alternate format such as FLAC or WAV, while avoiding replacing a usable local MP3 with an OGG generated for messaging compatibility. I added regression coverage for both paths covering:
The OGG/Opus conversion behavior itself remains unchanged and out of scope for this PR. Validation: |
|
Merged into main via consolidated salvage PR #73520 (merge Your contribution is credited to you in git history. Thank you! Closing this PR as merged-via-salvage. |
Summary
file_pathreturned bytext_to_speech_tool()when the requested MP3 was not produced.Motivation
CLI/TUI voice playback requested an MP3 path from
text_to_speech_tool(), but then ignored the tool response and attempted to play only that originally requested path.That works for providers that write exactly the requested MP3 file, but breaks for command providers or native-format providers that return a different output file via
file_path, such as FLAC/WAV/OGG output.In those cases the TTS tool can successfully synthesize audio, but CLI/TUI playback skips it because the requested MP3 path does not exist.
At the same time, some voice-compatible providers leave the requested MP3 in place while returning an adjacent OGG generated for messaging compatibility. Local playback should keep using the existing MP3 in that case because players such as
afplaydo not reliably handle OGG.Changes
text_to_speech_tool().result["file_path"]when the requested MP3 is missing or empty.HermesCLI._voice_speak_response()hermes_cli.voice.speak_text()Out of scope
This PR intentionally does not change when the TTS tool converts audio to OGG/Opus.
There appears to be a separate behavior where voice-compatible command providers may be converted to OGG/Opus even for local CLI/TUI playback, even though that conversion should not be necessary when the provider already produced a locally playable native format such as FLAC or WAV. This PR keeps that existing behavior unchanged, but the conversion trigger may be worth revisiting in a follow-up: for local CLI/TUI playback, preserving provider-native audio should be enough when no platform-specific voice-bubble format is required.
This PR only fixes the CLI/TUI caller contract: use the requested MP3 when available, otherwise use the concrete
file_pathreturned by the TTS tool.Test plan
Result: