fix(tts): remove Unix socket half-close that broke Kokoro TTS #4

Merged
mik-tf merged 2 commits from development_fix_kokoro_tts_halfclose into development 2026-04-21 20:40:52 +00:00
Member

Summary

  • Fixed Kokoro TTS silent failure caused by writer.shutdown() sending a TCP FIN (half-close) before reading the response
  • Removed tokio::io::split() in favor of using mut stream directly with Connection: close header
  • Updated default aibroker endpoint port from 9997 to 9988 and added /ui path for voice TTS
  • Reduced TTS text truncation limit from 3000 to 1000 characters

Closes #3

Changes

  • crates/hero_agent_server/src/routes.rs:
    • hero_voice_tts_unix(): removed tokio::io::split() and writer.shutdown(), use mut stream directly
    • Added Connection: close HTTP header to signal end-of-request without socket shutdown
    • Updated default aibroker port from 9997 to 9988 in chat() and voice_tts()
    • Added /ui path to voice TTS aibroker fallback URL
    • Reduced TTS text truncation from 3000 to 1000 chars

Test Results

  • 86 tests passed, 0 failures
## Summary - Fixed Kokoro TTS silent failure caused by `writer.shutdown()` sending a TCP FIN (half-close) before reading the response - Removed `tokio::io::split()` in favor of using `mut stream` directly with `Connection: close` header - Updated default aibroker endpoint port from 9997 to 9988 and added `/ui` path for voice TTS - Reduced TTS text truncation limit from 3000 to 1000 characters ## Related Issue Closes https://forge.ourworld.tf/lhumina_code/hero_agent/issues/3 ## Changes - `crates/hero_agent_server/src/routes.rs`: - `hero_voice_tts_unix()`: removed `tokio::io::split()` and `writer.shutdown()`, use `mut stream` directly - Added `Connection: close` HTTP header to signal end-of-request without socket shutdown - Updated default aibroker port from 9997 to 9988 in `chat()` and `voice_tts()` - Added `/ui` path to voice TTS aibroker fallback URL - Reduced TTS text truncation from 3000 to 1000 chars ## Test Results - 86 tests passed, 0 failures
mik-tf merged commit 43de440bd0 into development 2026-04-21 20:40:52 +00:00
mik-tf deleted branch development_fix_kokoro_tts_halfclose 2026-04-21 20:40:53 +00:00
Owner

Thanks.

Thanks.
Sign in to join this conversation.
No reviewers
No milestone
No project
No assignees
2 participants
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
lhumina_code/hero_agent!4
No description provided.