Skip to content

fix(voice-call): preserve Twilio greetings and resume listening after silence - #193137

Merged
roboclaw-bot merged 4 commits into
mainfrom
loop/contributor-pr-158357
Nov 5, 2026
Merged

roboclaw-bot merged 4 commits into
mainfrom
loop/contributor-pr-158357

Conversation

@roboclaw-bot

@roboclaw-bot roboclaw-bot commented Nov 5, 2026 •

Copy link
Copy Markdown
Collaborator

What Problem This Solves

Twilio conversation calls without media streams lose their Say greeting when a second live TwiML update replaces it, then disconnect after roughly five seconds of silence following a reply.

Supersedes #158357, thanks @cestercian
Fixes #158262

Result

Send Say followed by Gather in one conversation update. Gather waits up to 120 seconds and redirects silence to the signed webhook, which renews listening without replaying the greeting or resetting the existing call-duration limit. Distinct callback identities preserve repeated silence callbacks, and explicit conversation turns retain their token. Signature verification is unchanged.

#191264 owns the notification tail; this replacement leaves it alone. Direct-speech TwiML and streaming behavior are preserved.

The shared Gather builder removes duplicate rendering. Production remains +65/-24 (net +41) because webhook renewal and explicit-turn correlation require new flow code. Tests are +312/-2 (net +310); the exact 310-line allocation covers the signed-webhook boundary regression and independent TwiML contracts.

Proof

  • Red before the fix: run 41956885174, job 127014449625, test-only head 893166e08e4d0237d6fce0bf9ee8056bafad8d56. Node and Bun fail the intended greeting-count and Gather-timeout assertions. Direct-speech preservation passes.
  • Current-head proof: CI run 42004275034 succeeds at 92c7f88a8e2bc0fa52c7e0515c719baeb2f6d193. Job 127167828896 passes the 35-file/404-test voice-call groups on the current Bun plan, including all four signed-webhook scenarios and provider/manager/notify/streaming consumers. Production/test types, lint, source contracts, ratchet and repaired Windows partition shard pass. Darwin tooling run 42004275087 also succeeds. All attached Actions jobs were verified success/skipped before native submission.
  • Synthetic transport: the actual HTTP handler, HMAC verifier, call manager, isolated state store and Twilio XML generation process the fixture requests. Only external carrier HTTP and model inference are intercepted; no listener, real credentials, Team state or network request is used. Assertions cover inbound/outbound greetings, repeated silence, the next reply, invalid signatures, explicit-turn correlation and terminal cleanup.
  • Independent Codex autoreview: scoped-clean, P0–P3, full final diff from 5389c2a105cfa1d96b7c65691f5341abb3d2aab8 to the exact head above, with intact webhook/signature/replay/manager/provider context. No code or tests executed by the reviewer.
  • Code-scanning limitation: the separate aggregate CodeQL comparison is neutral because 18 main configurations were not found for comparison. Planned CodeQL and security-review Actions complete successfully; this does not claim complete aggregate scanning coverage.

Live-Twilio gap: no actual carrier call, audio playback observation, carrier timeout trace or real model response has been verified. Synthetic signed-webhook proof establishes the in-process call flow, not live carrier timing. Local test runs were not used because their compiled-worker preparation exceeds this production host's allowance.

@clawsweeper

clawsweeper Bot commented Nov 5, 2026 •

Copy link
Copy Markdown
Contributor

🦞👀
ClawSweeper picked this up.

Pull request received. I will update this pull request when review starts.

ClawSweeper review complete

ClawSweeper finished reviewing this revision. The review result is being finalized.

View the workflow run.

@openclaw-barnacle openclaw-barnacle Bot added channel: voice-call Channel integration: voice-call size: M docs Improvements or additions to documentation labels Nov 5, 2026
@clawsweeper clawsweeper Bot added clawsweeper:intake:bug Preliminary submission classification; full source review pending. clawsweeper:intake:needs-environment Preliminary submission classification; full source review pending. clawsweeper:intake:needs-repro Preliminary submission classification; full source review pending. P1 High-priority user-facing bug, regression, or broken workflow. rating: 🦪 silver shellfish Thin PR readiness signal; proof, validation, or implementation needs work. status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR. and removed clawsweeper:intake:bug Preliminary submission classification; full source review pending. clawsweeper:intake:needs-environment Preliminary submission classification; full source review pending. clawsweeper:intake:needs-repro Preliminary submission classification; full source review pending. labels Nov 5, 2026
@clawsweeper

clawsweeper Bot commented Nov 5, 2026

Copy link
Copy Markdown
Contributor

Codex review: needs maintainer review before merge.

What this changes

This PR combines Twilio conversation playback and listening, then renews speech collection after silence.

Example: A Twilio conversation with streaming disabled plays “Hello, this is a test,” then the caller stays silent.

  • Before: A second call update interrupts the greeting, and silence after a reply ends the call after about five seconds.
  • After: One update preserves the greeting and starts a 120-second Gather, which renews after silence within the existing call-duration limit.

Review scores

Measure Result What it means
Overall readiness 🦪 silver shellfish (2/6) The focused patch and meaningful regression composition support correctness, but supplied after-fix evidence remains synthetic.
Proof confidence 🦪 silver shellfish (2/6) Real behavior proof is not required for maintainer- or bot-authored pull requests.
Patch quality 🐚 platinum hermit (4/6) No actionable review findings were identified.

Product

Kind: Bug fix · Worth it: Yes · Fix scope: Complete
User problem: Twilio callers miss the conversation greeting and are disconnected after a short silent pause.
Reason: The released report and current source establish broken supported behavior, and the maintainer-authored replacement provides direction for a focused repair.

Merge readiness

✅ Ready for maintainer review

Keep this maintainer-authored draft open: it repairs a current Twilio conversation failure, and source review found no definite introduced correctness or security bug.

Priority: P1
Reviewed head: f6a015f1219f8a06fe874462fa74d2de1392b501

Before merge

None.

Findings

None.

Tests

  • Missing end-to-end proof: Live Twilio playback, an actual silence timeout and renewal, and subsequent speech resolving an explicit turn remain unproven.
Agent review details

How this fits together

The Voice Call manager sends playback and listening operations to the Twilio provider, which produces TwiML and processes signed carrier callbacks into call events.

flowchart TD
  A[Call manager] --> B[Twilio provider]
  B --> C[Say and Gather]
  C --> D[Signed webhook]
  D --> E[Speech event]
  E --> A
  D --> F[Silence renewal]
  F --> C
Loading

Technical review

Best possible solution:

Complete this provider-owned repair while preserving notification playback, streaming, explicit-turn correlation, and the existing call-duration cap.

Do we have a high-confidence way to reproduce the issue?

The released report and current-main source establish a concrete reproduction: call in Twilio conversation mode with streaming disabled, answer, and pause after a reply; no target code or live call was executed during this review.

Is this the best way to solve the issue?

The patch repairs the existing manager/provider boundary with one Gather renderer, removes the competing Twilio update, and preserves the shipped direct-speech and streaming paths without adding another state owner.

AGENTS.md: found and applied where relevant.

Codex review notes: model internal, reasoning medium; reviewed against ffbbb514ba3b.

Provenance checked

  • Initial-message playback and listening changes intended behavior with a stated reason (455e84f: Started listening after Telnyx greetings while retaining a non-streaming Twilio listening update.)
  • Successful greeting playback and retry lifecycle keeps the original intent (Voice Call: enforce spoken-output contract and fix stream TTS silence regression #51500: Prevented silent playback failures and retained the initial message until playback succeeded.)
  • Twilio replay identity and explicit-turn correlation keeps the original intent (1d28da5: Blocked webhook replay and stale transitions using authenticated delivery identity and turn-scoped speech callbacks.)
  • Awaited persistence and lifecycle effects keeps the original intent (refactor(voice-call): await call persistence and lifecycle work #145047: Required persisted call mutations before publishing lifecycle effects while keeping carrier operations outside the mutation queue.)

Testing

Proof path: in-process harness.

Security

None.

Evidence

What I checked:

Likely related people:

  • Josh Avant: Raw commit 3f7f2c8 adds extensions/voice-call/src/manager/outbound.ts:264 relative to its recorded parents. This identifies author metadata, not feature responsibility or a PR merger. (role: source-line author; confidence: high; commits: 3f7f2c8dc96e; files: extensions/voice-call/src/manager/outbound.ts)

PR surface

Source +41, Tests +311, Docs +1, Other +2. Total +355 across 10 files. Added test files: 1.

View PR surface stats
Area Files Added Removed Net
Source 3 65 24 +41
Tests 5 313 2 +311
Docs 1 1 0 +1
Config 0 0 0 0
Generated 0 0 0 0
Other 1 2 0 +2
Total 10 381 26 +355

Preflight source

Source unknown. Source comparison at the observed PR snapshot only. Completion is self-reported; body, policy, tests, execution, and report bytes are not verified.

Review metrics

Metric Value Why it matters
Production versus regression code Production +65/-24; tests +312/-2 Production growth implements renewal and token propagation within existing owners; tests cover greeting sequencing, successive silence, later speech, explicit turns, and retained direct playback.

Root-cause cluster

Relationship: fixed_by_candidate
Canonical: #158262
Summary: This PR is the replacement candidate for the reported fallback greeting and silence failures; notification settlement is adjacent work.

Members:

Proposal only: this assessment does not dispatch repair, suppress jobs, mutate sibling items, close, or merge anything.

Labels

Label changes:

  • add P1: The supported non-streaming Twilio conversation path interrupts greetings and prematurely disconnects callers on current main.
  • add rating: 🦪 silver shellfish: Overall readiness is 🦪 silver shellfish; proof is 🦪 silver shellfish and patch quality is 🐚 platinum hermit.
  • add status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR.

Label justifications:

  • P1: The supported non-streaming Twilio conversation path interrupts greetings and prematurely disconnects callers on current main.
  • rating: 🦪 silver shellfish: Overall readiness is 🦪 silver shellfish; proof is 🦪 silver shellfish and patch quality is 🐚 platinum hermit.
  • status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR.

Rating scale

6/6 🦀 challenger crab · 5/6 🦞 diamond lobster · 4/6 🐚 platinum hermit · 3/6 🦐 gold shrimp · 2/6 🦪 silver shellfish · 1/6 🧂 unranked krab. Overall follows the weaker of proof and patch quality; ✨ marks media proof (a screenshot, video, or linked artifact) that directly shows the changed behavior.

Workflow

ClawSweeper edits this one comment on every review. Comment @clawsweeper re-review for a fresh review only. Repair and merge execution lanes are retired.

Reviewed November 4, 2026, 10:29 PM ET / November 5, 2026, 03:29 UTC.

@roboclaw-bot
roboclaw-bot marked this pull request as ready for review November 5, 2026 03:44
@roboclaw-bot
roboclaw-bot force-pushed the loop/contributor-pr-158357 branch 2 times, most recently from 89c3b16 to 8eedb6a Compare November 5, 2026 08:34
roboclaw-bot and others added 4 commits November 5, 2026 09:39
…ations

Keep fallback playback and token-scoped speech collection in one TwiML update.
Renew the gather through the signed webhook after silence without replaying the
greeting or treating identical later silence callbacks as webhook replays.
Preserve direct-speech and notification behavior owned by the separate notify fix.

Co-authored-by: Cestercian <[email protected]>
@roboclaw-bot
roboclaw-bot force-pushed the loop/contributor-pr-158357 branch from 8eedb6a to 92c7f88 Compare November 5, 2026 09:40
@roboclaw-bot
roboclaw-bot merged commit 486a0bd into main Nov 5, 2026
134 checks passed
@roboclaw-bot
roboclaw-bot deleted the loop/contributor-pr-158357 branch November 5, 2026 09:59
@roboclaw-bot

Copy link
Copy Markdown
Collaborator Author

Merged via squash.

tideclaw-bot pushed a commit that referenced this pull request Nov 6, 2026
… silence (#193137)

Preserve the Twilio Say fallback greeting by sending playback and listening in one conversation update. Renew a longer Gather through signed webhook silence redirects, retaining explicit turn correlation. Keep the direct and notify paths unchanged.

Add regression coverage through the actual signed voice-call webhook handler using synthetic carrier transport. Allocate 310 net test lines for that boundary regression and independent TwiML contracts. Real Twilio call playback and timeout timing remain unverified.

Supersedes #158357, thanks @cestercian
Fixes #158262

Co-authored-by: Cestercian <[email protected]>

Backport-source: 486a0bd
Backport-scope: Carry turnToken; let Say own following Gather; signed listen callbacks rearm without fake answered events. Preserve realtime, non-Twilio, notify-only and webhook checks.

Adapted production backport for release/2026.11.2. Upstream validation descriptions refer to source history; candidate regression coverage and remote qualification are tracked separately.

Co-authored-by: RomneyDa <[email protected]>
github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Nov 6, 2026
… silence (openclaw#193137)

Preserve the Twilio Say fallback greeting by sending playback and listening in one conversation update. Renew a longer Gather through signed webhook silence redirects, retaining explicit turn correlation. Keep the direct and notify paths unchanged.

Add regression coverage through the actual signed voice-call webhook handler using synthetic carrier transport. Allocate 310 net test lines for that boundary regression and independent TwiML contracts. Real Twilio call playback and timeout timing remain unverified.

Supersedes openclaw#158357, thanks @cestercian
Fixes openclaw#158262

Co-authored-by: Cestercian <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

channel: voice-call Channel integration: voice-call docs Improvements or additions to documentation P1 High-priority user-facing bug, regression, or broken workflow. rating: 🦪 silver shellfish Thin PR readiness signal; proof, validation, or implementation needs work. size: M status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Bug]: voice-call Twilio <Say> fallback: initial greeting cut off by second live TwiML update; call hangs up 5s after each reply

1 participant