Repository navigation
fix(voice-call): avoid audio pacing slowdowns on long replies - #117162
Conversation
* commit 'd8f229f2e6c39e2dc694730c2efc479e4fb3871e': (59 commits) fix(setup): isolate failed channel probes and report doctor diagnostics (#116824) fix(telegram): preserve edit previews, message cache, and group history (#116818) fix(whatsapp): preserve interactive replies and normalize media MIME (#116816) fix(file-transfer): keep fetched media attachable in sandboxed replies (#116400) fix(browser): preserve doctor JSON failure status (#116811) fix(ollama): stream native tool call lifecycle (#116809) fix(matrix): preserve message-tool room thread routing (#116802) fix(ui): restore mobile navigation and accessible usage filters (#116751) fix(ui): coalesce profile identity refresh (#116764) fix(ui): preserve chat attachments and run ownership (#116752) fix(plugins): clean up partial service startup once (#116804) fix(qa-channel): enforce message and thread lifecycle ownership (#116801) fix(qa-lab): support groups and isolate thread timelines (#116803) feat(plugins): externalize Voyage embeddings (#116785) fix(outbound): strip echoed inbound metadata before delivery (#50520) fix(anthropic-vertex): correct multi-region endpoints (#116757) fix(ui): scope agent cron jobs and surface model catalog failures (#116771) fix(ui): preserve scoped session state across updates (#116772) fix(build): fail closed on symlinked build output roots (#116705) fix(commands): validate native settings and preserve Telegram ingress outcomes (#116773) ...
* commit 'c41f033b87545b658215a9c3bbe03f88fbaa867d': (347 commits) refactor(plugins): consolidate descriptor and startup ownership (#117146) fix(messages): reply actions leak citation markers and reply/poll answers draw the no-reply fallback (#116909) fix(slack): let durable ingress retry transient thread lookups (#117135) refactor(doctor): consolidate shipped state migration ownership (#117142) fix(ai): Codex stream shows internal parser text on a malformed frame (#116966) fix: guard every migrated session accessor path (#117140) fix(terminal): measure unicode display width consistently (#117062) fix(openai): clear ChatGPT SSE fallback per session (#117123) fix(mistral): reject incomplete streamed tool terminals (#117137) fix(ai): preserve structured chat content and refusals (#117136) fix(doctor): persist normalized agent roster (#117115) fix(signal): avoid replay after ambiguous quote delivery errors (#117134) fix(cron): reject disabled delivery accounts when scheduling (#116899) fix(gateway): honor HTTP If-Modified-Since media validators (#117133) fix(config): delete one array element per config patch delete (#116463) fix(plugins): report installed dependency health authoritatively (#117029) fix(ui): recover moving sessions across paged gateway rosters (#117016) fix(ui): clear hidden session selection before bulk deletion (#117015) fix(discord): avoid replaying ambiguous voice deliveries (#117127) fix(ui): scope Gateway reconnect lineage to its target (#117125) ...
* commit '475ea69f2c356104f4b601f4976788081e79b8b4': refactor(agents): consolidate context budgets and compaction recovery (#117149) fix(net-policy): redact sig and x-* auth params in URLs and bodies (#116957) refactor(agents): remove duplicate generated-media delivery fallbacks (#117150) refactor(reply): unify turn lifecycle state ownership (#117145) fix(ui): preserve emoji agent avatar initials (#104912) refactor(auto-reply): unify command and directive ownership (#117143)
|
@clawsweeper re-review Please review exact head |
|
🦞🧹 I asked ClawSweeper to review this item again. Re-review progress:
|
|
Codex review: needs maintainer review before merge. Reviewed July 31, 2026, 10:18 PM ET / August 1, 2026, 02:18 UTC. ClawSweeper reviewWhat this changesThe PR changes the realtime voice-call audio pacer to consume queued audio and marks with a head index plus periodic compaction instead of repeatedly shifting the front of a JavaScript array, and adds long-backlog regression tests. Merge readinessThe PR fixes a source-proven quadratic dequeue in the voice-call pacing owner, and the head-index/compaction implementation preserves its existing queue, byte-accounting, mark, clear, close, and backpressure boundaries. No discrete correctness or security defect was found; because this is a maintainer-authored, maintainer-labeled PR and GitHub reports it behind current Priority: P2 Review scores
Verification
How this fits togetherRealtime voice providers send mu-law output into the voice-call bridge, which hands it to the audio pacer before Twilio or Telnyx wire-format serialization and WebSocket delivery. The pacer owns queue ordering, pacing timers, queued-byte limits, clearing, closure, and backpressure outcomes. flowchart LR
A[Realtime provider audio] --> B[Voice-call bridge]
B --> C[Audio pacer]
C --> D[Queue and pacing decision]
D --> E[Twilio or Telnyx serializer]
E --> F[Telephony WebSocket]
B --> G[Barge-in and clear events]
G --> C
Decision needed
Why: The patch is technically sound, but this is a maintainer-authored and Before merge
Agent review detailsSecurityNone. PR surfaceSource +31, Tests +74. Total +105 across 2 files. View PR surface stats
Review metricsNone. Merge-risk optionsMaintainer options:
Technical reviewBest possible solution: Land the owner-local queue repair after refreshing the branch against current Do we have a high-confidence way to reproduce the issue? Yes, from source: current main queues up to 960,000 bytes and removes one 160-byte frame at a time with Is this the best way to solve the issue? Yes. Keeping the head-index dequeue and bounded compaction inside AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning high; reviewed against 1e0f62ebfeae. LabelsLabel changes:
Label justifications:
EvidenceWhat I checked:
Likely related people:
Rank-up movesOptional improvements that raise the rating; they are not merge blockers.
Rating scale
Overall follows the weaker of proof and patch quality. Workflow
|
|
@clawsweeper re-review Please review final exact head |
|
🦞🧹 I asked ClawSweeper to review this item again. Re-review progress:
|
|
Merged without squash.
ClawSweeper rank-up moves were satisfied before landing: exact-head required checks completed successfully, and the maintainer explicitly authorized verified landing. |
…aw#117162) Merge PR openclaw#117162 without squash to preserve the signed commit series.
Related: #116201
What Problem This Solves
Fixes an issue where long realtime voice-call replies could create increasing event-loop work while audio was being paced to the telephony stream. The default two-minute queue can hold 6,000 frames, and removing each frame from the front of the array repeatedly copied the remaining backlog.
Why This Change Was Made
The voice-call audio pacer now advances a head index and periodically compacts consumed storage instead of shifting the array for every 20 ms frame. This stays inside the telephony pacing owner and preserves frame/mark order, queued-byte accounting, clear, close, send-failure, and backpressure behavior.
No provider, barge-in, config, environment-variable, SDK, or public API surface changes.
User Impact
Long realtime replies keep the same audio cadence and interruption behavior with bounded queue-maintenance work. Normal and short replies behave exactly as before.
Evidence
mainsource proof: the default 960,000-byte queue can contain 6,000 160-byte frames, and each paced send usedArray.shift().clearAudio()returns the exact remaining 47,840 bytes and cancels later sends.cd1e3b4c9794813d4195425a7603e58e2dea19d1, including signedmainrefresh7fba71eb7aeb73f6a3b146389e251625efb4fd07.extensions/voice-callBlacksmith Testbox suite on the final head: 57 files / 582 tests passed (run).Provenance
The front-array dequeue was introduced in #77064 on May 4, 2026. Code author: @scoootscooob. Landed by @steipete.
Best-Fix Review
Best fix: keep the bounded head-index queue inside
RealtimeAudioPacer, where byte limits, ordering, timers, clear, close, and backpressure are owned.Alternatives rejected:
Scope
extensions/voice-call/src/webhook/realtime-audio-pacer.tsextensions/voice-call/src/webhook/realtime-audio-pacer.test.ts