fix(ios): prefetch incremental talk tts audio#22833
Merged
Conversation
b45f4f8 to
741c537
Compare
Contributor
Author
BunsDev
pushed a commit
that referenced
this pull request
Feb 21, 2026
obviyus
pushed a commit
to guirguispierre/openclaw
that referenced
this pull request
Feb 22, 2026
00xglitch
pushed a commit
to 00xglitch/openclaw
that referenced
this pull request
Feb 22, 2026
00xglitch
pushed a commit
to 00xglitch/openclaw
that referenced
this pull request
Feb 23, 2026
This was referenced Feb 23, 2026
mreedr
pushed a commit
to mreedr/openclaw-custom
that referenced
this pull request
Feb 24, 2026
00xglitch
pushed a commit
to 00xglitch/openclaw
that referenced
this pull request
Feb 24, 2026
00xglitch
pushed a commit
to 00xglitch/openclaw
that referenced
this pull request
Feb 24, 2026
clawd-xsl
pushed a commit
to clawd-xsl/openclaw
that referenced
this pull request
Feb 26, 2026
6 tasks
zooqueen
pushed a commit
to hanzoai/bot
that referenced
this pull request
Mar 6, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Describe the problem and fix in 2–5 bullets:
TalkModeManagerso upcoming segment audio is requested while current segment is playing, then reused for immediate next playback.mp3_44100) when PCM is restricted by plan.Change Type (select all)
Scope (select all touched areas)
Linked Issue/PR
User-visible / Behavior Changes
Security Impact (required)
No)No)No) (same ElevenLabs endpoint; call timing changed via prefetch)No)No)Yes, explain risk + mitigation:Repro + Verification
Environment
Steps
Expected
Actual
prefetch readyfollowed byprefetch hit/prefetched=trueon subsequent segments.Evidence
Attach at least one:
Human Verification (required)
What you personally verified (not just CI), and how:
xcodebuildDebug build succeeds for iOS after changes.prefetch ready+prefetch hit) and removal of prior 403 prefetch failures in the updated path.Compatibility / Migration
Yes)No)No)Failure Recovery (if this breaks)
apps/ios/Sources/Voice/TalkModeManager.swiftapps/ios/Sources/Gateway/GatewayConnectionController.swiftRisks and Mitigations
List only real risks for this PR. Add/remove entries as needed. If none, write
None.Greptile Summary
Adds best-effort prefetch for upcoming incremental TTS segments in Talk mode on iOS. While the current segment plays, the next segment's audio is requested from ElevenLabs in the background and buffered. When playback advances, prefetched audio is consumed immediately, eliminating the inter-sentence dead air caused by serial synthesis requests.
IncrementalSpeechPrefetchStateandIncrementalPrefetchedAudioto manage prefetch lifecycle and buffered audio data.startIncrementalPrefetchMonitor) watches for the next queued segment and triggers prefetch during playback.mp3_44100instead, and the playback path correctly routes to the mp3 player.resetIncrementalSpeech,cancelIncrementalSpeech, and the speech task'sdeferblock to clean up in-flight prefetch on interrupt/reset/teardown.makeIncrementalTTSRequestto eliminate duplicated request construction logic.GatewayConnectionController.swift: replacesntohl()with Swift-nativeUInt32(bigEndian:)for IPv4 loopback detection (functionally equivalent).Confidence Score: 4/5
ntohl→UInt32(bigEndian:)change is functionally equivalent. No security or data-access changes. Score docked from 5 only because the prefetch polling monitor and async task await patterns add concurrency complexity that would benefit from automated test coverage.TalkModeManager.swiftcarries the bulk of the change but the logic is sound.Last reviewed commit: b45f4f8