Repository navigation
Conversation
|
🦞👀 Pull request received. I will update this pull request when review starts. ClawSweeper review completeClawSweeper finished reviewing this revision. The review result is being finalized. |
|
Codex review: blocked before merge. Reviewed October 4, 2026, 2:49 PM ET / 18:49 UTC (Revision 14). ClawSweeper reviewWhat this changesThe voice-call plugin protects opening greetings from interruption until carrier playback is acknowledged, temporarily replacing caller input with silence and adding carrier-boundary regressions. Merge readiness⛔ Blocked before merge - 3 items remain This remains a useful, proven fix that main does not provide. Earlier findings are addressed; the unresolved blocker is owner acceptance of the stalled-greeting caller experience. Priority: P1 Review scores
Verification
How this fits togetherThe voice-call plugin connects telephony audio to realtime voice providers. Its webhook handler paces assistant speech to the carrier and controls when caller speech can interrupt playback. flowchart TD
A[Caller audio] --> B[Voice-call handler]
C[Initial greeting] --> D[Realtime voice provider]
D --> E[Paced carrier playback]
E --> F[Playback acknowledgment]
F --> B
B --> G[Greeting protected?]
G -->|Yes| H[Send silence to provider]
G -->|No| D
Decision needed
Why: Protecting a delayed greeting and keeping the caller responsive conflict in the stall case; changing that tradeoff requires voice-call product intent. Before merge
Agent review detailsSecurityNone. PR surfaceSource +179, Tests +533. Total +712 across 2 files. View PR surface stats
Review metrics
Merge-risk optionsMaintainer options:
Technical reviewBest possible solution: Preserve carrier-confirmed greeting protection while giving stalled greetings an owner-approved recovery outcome that avoids prolonged unexplained caller silence. Do we have a high-confidence way to reproduce the issue? Yes, source establishes the current-main failure path: an early local or provider interruption clears queued opening audio. The linked report supplies an official-release call scenario; this review did not execute it. Is this the best way to solve the issue? Unclear for the stall case: carrier acknowledgment is the appropriate playback boundary, but unconditional prolonged caller suppression still needs an owner-approved recovery policy. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning medium; reviewed against 0816aa1b57dc. LabelsLabel changes: No label 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
HistoryReview history (13 earlier review cycles; latest 8 shown)
|
|
@clawsweeper re-review The findings from the last review have been addressed on the current head; the PR body now carries a "Review response" section with the reworked behaviour and the after-fix regression tests (names + exact command + observed result). passes on the branch. |
|
🦞👀 Re-review progress:
|
|
@clawsweeper re-review |
|
🦞👀 Re-review progress:
|
Real-call proof on head
|
|
@clawsweeper re-review |
|
🦞👀 Re-review progress:
|
Fix for the Rev 7 P1 — head
|
| Check | Result |
|---|---|
| Focused greeting-protection suite | 6/6 passed |
| Full voice-call extension suite | 687 passed / 9 failed |
| oxlint (changed files) | 0 warnings / 0 errors |
typecheck (tsgo) |
deferred to CI |
The 9 failures are pre-existing and unrelated: all in extensions/voice-call/index.test.ts / index.lifecycle.test.ts (plugin runtime bootstrap). A baseline run with this patch reverted shows the identical 9-failure set (686 passed), so the change introduces none.
@clawsweeper re-review
|
Thanks @clawsweeper — re-reviewing the two Rev 11 findings. P2 (suppression log once per window) — fixed. P3 ( Verification. Focused greeting-protection suite 7/7 (wall ~9 s). Full voice-call lane 688 passed / 9 failed; the 9 failures are the pre-existing plugin registration/lifecycle cases in @clawsweeper re-review |
|
🦞👀 Re-review progress:
|
|
🦞👀 Re-review progress:
|
|
P3 (polling waits in the carrier regression suite) — addressed Fixed in Why the polling was load-bearing The audio pacer paces on real
What changed
No sleeps, timers, or Evidence
Tradeoffs worth recording
The separate 30 s stalled-greeting mute decision is untouched by this change. |
|
P3 (polling waits in the carrier suite) is addressed in @clawsweeper re-review |
|
🦞👀 Re-review progress:
|
|
Ready for maintainer review at head Both open findings from the last review pass are addressed — P2 (suppression-log dedup) and P3 (replaced the greeting suite's
|
An outbound realtime call queued its opening greeting as one large audio burst. A barge-in arriving while that burst was still queued - the local speech gate, or a provider VAD interrupt - cleared the whole burst and cancelled the greeting turn, so the callee heard only the first sliver and sat in silence (a live outbound call lost a 53760-byte opening 0.3s after the callee said "Hello"). Arm a greeting-protection window when the provider becomes ready with an initial greeting. While armed: - cancelOutputAudioForBargeIn returns early and the audio sink ignores reason === "barge-in", so neither barge-in path clears outbound audio or cancels the greeting turn; - the caller's audio is muted to the provider (mu-law silence) so a barge-in is never taken as a user turn. The window disarms once the greeting has genuinely played out - the turn is complete, the pacer is drained and the line has been quiet for a sustained interval - or after a hard timeout, whichever comes first, and on session close, so normal barge-in resumes afterwards.
oxlint's typescript(no-base-to-string) rule flags data.toString() on the untyped ws message payload and fails the changed-extensions lint lane. Type the callback as RawData and normalize to a Buffer like the sibling realtime-handler test.
…yout The opening greeting is queued as one large audio burst. Protection used to release on a sustained-quiet heuristic or, once the completion mark was queued, on a short fixed grace. Both substituted for the carrier's own playout signal: a stalled pre-audio window kept caller audio muted past the point the provider could answer, and the mark grace released before the carrier had actually played the greeting tail. - Separate "window armed" from "caller audio muted" so a stalled pre-audio wait releases caller audio while the window stays armed for a late burst. - Drop the mark-grace release; protection now ends only on carrier acknowledgement, an explicit failed/incomplete/no-audio outcome, session close, or the 30s outermost backstop. - Let onResponseDone treat a completed turn with no audio as terminal. - Tests drive the real completion mark and prove silence/non-silence via observable media using selective fake timers.
A continuity reset discards the queued greeting and its pending carrier mark acknowledgement. Disarm the greeting window before clearing playback because there is no longer a greeting tail to protect; this promptly restores caller audio and barge-in without changing the carrier-confirmed normal path.
…d greeting Keep caller audio muted to the provider for the whole pre-audio greeting window instead of releasing it after 3 s, so a delayed greeting cannot be barged in before its first chunk. Release only on a terminal signal: a response that ends without audio, a cancelled response, or the 30 s backstop. Treat a cancelled response as its own terminal case: end greeting protection without arming a completion mark behind partial output. Co-Authored-By: Claude Opus 5.5 <[email protected]>
…window The realtime local-speech suppression veto fires per audio frame during greeting protection and logged on every trigger, flooding the console for the whole protection window. Gate the log behind greetingLocalSpeechSuppressionLogged, reset on both armGreetingWindow and disarmGreetingWindow so each window emits the message at most once. The emitted text and the veto (return false) are unchanged, so trace-redactor markers and barge-in behaviour are unaffected.
…of polling Replace the vi.waitFor sampling in the greeting-protection carrier suite with event-driven awaits, preserving every assertion and the frame ordering: - bridge creation: a deferred resolved inside the bridge factory replaces the "callbacks defined" poll - provider audio: expectCallerAudio arms a deferred before sending the caller frame and awaits the bridge sendAudio callback; the 4-frame loop awaits a counter, not a length sample - carrier frames: observeCarrierFrames exposes waitForFrame(predicate), which checks existing frames first and otherwise resolves on the next match - drain: wait for the pacer's own openclaw-playout-* boundary before the fake-clock poll re-runs, since the pacer paces on real time while the suite fakes Date/setInterval No sleeps or timers are added as synchronization. Focused suite 7/7, oxlint clean.
…g suite
The rebase onto current main picks up the shared connectCarrierStream helper,
which now registers onTestFinished(ws.terminate(); handler.close();
server.close()). The greeting suite also tore down the same resources itself,
so its server.close() ran a second time and the promisified close callback
rejected with ERR_SERVER_NOT_RUNNING, failing every test in the file.
Drop the duplicated teardown and the now-unused `server` binding, keeping only
test-local cleanup (vi.useRealTimers, log.mockRestore) and unwrapping the two
try/finally blocks that became empty. This matches the base's own
realtime-handler.lifecycle.test.ts usage (`const { ws } = await
connectCarrierStream(handler)`).
5e3c640 to
bc75528
Compare
…ptions (#191584) Preserve the opening voice-call response and its queued carrier playback when early caller speech or noise would otherwise trigger local or provider barge-in. Withhold overlapping input through the opening, then restore normal interruption after response completion and playback drain. Reuse the existing audio controller and playback clock, excluding the answering-machine hold acknowledgement. Supersedes #159144, thanks @mnowrot. Co-authored-by: mnowrot <[email protected]>
|
Thanks @mnowrot for finding and developing this fix! The focused replacement landed in #191584 (399cb0b), with your authorship preserved. Its fake-carrier regression fails on main and passes with opening protection, later turns still allow barge-in, and CI passed. Closing this as superseded by that merged fix. |
…ptions (openclaw#191584) Preserve the opening voice-call response and its queued carrier playback when early caller speech or noise would otherwise trigger local or provider barge-in. Withhold overlapping input through the opening, then restore normal interruption after response completion and playback drain. Reuse the existing audio controller and playback clock, excluding the answering-machine hold acknowledgement. Supersedes openclaw#159144, thanks @mnowrot. Co-authored-by: mnowrot <[email protected]>
Closes #159139
What Problem This Solves
Fixes: a realtime call's opening greeting is cut off a fraction of a second in when the callee barges in, because a barge-in clears the whole queued greeting burst and cancels the greeting turn.
User Impact
User impact: the callee hears the complete opening greeting (including any consent or intro question) before barge-in takes effect; barge-in behaves normally again once the greeting has played.
Why This Change Was Made
The greeting is generated once and queued as a single large burst, so any barge-in — the local RMS gate or a provider VAD interrupt — during that burst was destructive. A greeting-protection window, armed when the provider becomes ready with an initial greeting, now holds both barge-in entry points off and mutes the caller's audio to the provider so a barge-in is not interpreted as an answer; the window disarms once the greeting has actually played out (turn complete, pacer drained, sustained quiet) or after a hard timeout, whichever comes first.
Evidence
Live calls before the change:
6240a23dlost a full 53 760-byte opening 0.3 s after the callee said "Hello";8d938602lost the rest after an early disarm with 34 240 bytes queued. After the change,3f7686b0andd003a231kept the greeting intact through two provider barge-ins (log:outbound audio kept by provider barge-in during greeting protection), with nocleared byline, and disarmedreason=played-outafter the full consent question.pnpm tsgo:extensionspasses on the branch.Review response
Reworked on head
e19494fain response to the review:Tests added (green):
mutes caller audio to the provider while the opening greeting is protectedkeeps protection until the carrier confirms the greeting played, then resumes caller audioreleases caller audio when the greeting never produces audioCommand:
node --import ./scripts/tsx.mjs scripts/run-vitest.mjs run extensions/voice-call/src/webhook/realtime-handler.greeting-protection.test.ts— observed3 passed.pnpm tsgo:extensionspasses on the branch.Review response
CI
check-lint-core-2failed on the new greeting-protection test: oxlinttypescript(no-base-to-string)flaggeddata.toString()on the untypedwsmessage payload.Fixed in
c39c530f— thews.on("message")callback is typed asRawDataand normalized to aBuffer(same pattern asrealtime-handler.test.ts).node scripts/run-oxlint.mjs --tsconfig extensions/tsconfig.json extensions/voice-call/src/webhook/realtime-handler.greeting-protection.test.ts→Found 0 warnings and 0 errors.node --import ./scripts/tsx.mjs scripts/run-vitest.mjs run extensions/voice-call/src/webhook/realtime-handler.greeting-protection.test.ts→3 passedpnpm tsgo:extensions→ exit 0Review response — Revision 5 (real-call proof)
Standing on head
052846f6309. Patch quality is 4/6 with no actionable findings; theremaining ask is evidence on this head. This section records the current-head verification
and the exact live-call signature the proof will carry.
Verification on this head (host, Node 26)
node --import ./scripts/tsx.mjs scripts/run-vitest.mjs run extensions/voice-call/src/webhook/realtime-handler.greeting-protection.test.tsnode --import ./scripts/tsx.mjs scripts/run-vitest.mjs run extensions/voice-call/src/webhook/realtime-handler.test.tsnode scripts/run-tsgo.mjs -p tsconfig.extensions.jsonnode scripts/run-oxlint.mjs --tsconfig extensions/tsconfig.json extensions/voice-call/src/webhook/realtime-handler.ts extensions/voice-call/src/webhook/realtime-handler.greeting-protection.test.tsReal-call trace on this head (captured)
Captured on
@openclaw/[email protected], built from this PR's source at head052846f6309and loaded by the voice-call host. Build hashes: tarballefe73021…89b4·dist/index.js3f26cdc9…6f40· handler chunk67592bfd…b097.All three phases in one call — greeting protected, carrier-confirmed disarm, caller input resumed:
Real-call trace excerpt on
2026.9.6-pr159144.052846f(redacted: callId->call-A, providerCallId->sid-A; numbers/hosts/URIs/tokens stripped; caller speech intext=blanked). Shows greeting-protection armed; the caller's barge-in was suppressed during the window (muted to provider + local speech suppressed) so the greeting audio was never cleared; carrier-confirmed disarm (reason=carrier-confirmed); and caller input resumed after disarm.Capture and redaction procedure
2>&1 | teeorjournalctl -u <unit> -f -o cat).[voice-call] realtimelines for thatcallIdfrom the set listed above.callId/providerCallId→ pseudonyms; strip numbers, SIP URIs/hostnames/endpoints, credentials.