Skip to content

Fix socat dropping results on longer recordings#10

Merged
csheaff merged 1 commit intomainfrom
fix/socat-shutdown-timeout
Feb 22, 2026
Merged

Fix socat dropping results on longer recordings#10
csheaff merged 1 commit intomainfrom
fix/socat-shutdown-timeout

Conversation

@csheaff
Copy link
Owner

@csheaff csheaff commented Feb 22, 2026

Summary

  • Root cause: socat's -t flag (shutdown timeout after stdin EOF) defaults to 0.5s. When the whisper daemon takes longer than that to transcribe dense speech, socat disconnects before receiving the result — causing BrokenPipeError in the daemon and "no speech detected" for the user.
  • Fix: Add -t 120 to all socat calls across all server backends so socat waits for the daemon's response.
  • Bonus: Add daemon logging to $XDG_RUNTIME_DIR/talktype-whisper.log for diagnosing future issues, and retry logic in transcribe-server when the daemon dies mid-request.

Test plan

  • All existing BATS tests pass (make test)
  • Reproduced bug by generating long speech audio — without -t, socat returns empty; with -t 120, transcription succeeds
  • Verified with real dictation of varying lengths (short phrases through multi-paragraph readings)
  • ShellCheck and py_compile pass on all modified files

🤖 Generated with Claude Code

socat's -t flag (shutdown timeout after stdin EOF) defaults to 0.5s.
When the transcription daemon takes longer than that to process dense
speech, socat disconnects before receiving the result, causing a
BrokenPipeError in the daemon and "no speech detected" for the user.

Add -t 120 to all socat calls so it waits for the daemon's response.
Also add daemon logging to $XDG_RUNTIME_DIR/talktype-whisper.log and
retry logic in transcribe-server when the daemon dies mid-request.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@csheaff csheaff merged commit ad8f2ba into main Feb 22, 2026
6 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant