Skip to content

Fix speech to text on macOS#1922

Merged
dgageot merged 2 commits intodocker:mainfrom
dgageot:speak
Mar 4, 2026
Merged

Fix speech to text on macOS#1922
dgageot merged 2 commits intodocker:mainfrom
dgageot:speak

Conversation

@dgageot
Copy link
Member

@dgageot dgageot commented Mar 4, 2026

Fixes #1919

docker-agent[bot]

This comment was marked as outdated.

dgageot added 2 commits March 4, 2026 17:11
Fixes docker#1919

Signed-off-by: David Gageot <david.gageot@docker.com>
Signed-off-by: David Gageot <david.gageot@docker.com>
@dgageot dgageot requested a review from a team as a code owner March 4, 2026 16:17
@dgageot
Copy link
Member Author

dgageot commented Mar 4, 2026

/review

Copy link

@docker-agent docker-agent bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Review Summary

Assessment: 🟢 APPROVE

This PR correctly implements speech-to-text functionality for macOS with proper channel lifecycle management and goroutine coordination. The code was thoroughly analyzed for concurrency issues, resource leaks, and error handling. All potential concerns were verified and found to be false positives:

Channel safety: The transcriber callback captures its channel reference at creation time, preventing race conditions when the channel is closed
Goroutine lifecycle: closeTranscriptCh() properly unblocks waiting goroutines; the IsRunning() guard prevents overlapping sessions
Message ordering: Bubble Tea's event loop ensures all buffered transcript deltas are processed before sending content
Error handling: The error path correctly returns early without setting recording UI state

The implementation demonstrates good understanding of Go concurrency patterns and Bubble Tea's event-driven architecture.

Code Quality Notes

  • The buffered channel (capacity 100) with select-default pattern appropriately prevents blocking the audio thread
  • Cleanup in cleanupAll() properly stops the transcriber and closes channels
  • The Enter/ESC key handling during transcription is intuitive and well-implemented

Recommendation: Ready to merge ✅

@dgageot dgageot changed the title Fix text to speech on macOS Fix speech to text on macOS Mar 4, 2026
Copy link
Contributor

@aheritier aheritier left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@dgageot dgageot merged commit d016736 into docker:main Mar 4, 2026
11 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.

/speak not working - Speech-to-text is not yet supported

2 participants