Repository navigation
fix(voice-call): expose realtime/streaming stream paths through tailscale serve/funnel - #125468
Conversation
…cale serve/funnel Tailscale serve/funnel now auto-exposes the realtime and streaming WebSocket stream paths when those audio modes are enabled; previously Twilio <Connect><Stream> could not reach wss://<ts-host><streamPath> and realtime calls dropped after ~1s with no log. Also: CLI voicecall expose mounts/clears stream paths symmetrically, partial tailscale mounts roll back on failure, and a warning now fires when a call's stream WebSocket never arrives within the token TTL. Reported/observed live by Peter Steinberger.
|
🦞👀 Pull request received. I will update this pull request when review starts. |
|
Codex review: needs maintainer review before merge. Reviewed August 17, 2026, 9:03 PM ET / August 18, 2026, 01:03 UTC. ClawSweeper reviewWhat this changesThis PR makes the voice-call plugin expose realtime and streaming WebSocket routes through Tailscale Serve and Funnel, with shared setup, rollback, cleanup, CLI output, tests, and docs. Regression provenancePossible regression — suspected (reviewed change). No predecessor PR is attributed. Merge readinessKeep open for maintainer review: the patch appears to repair the missing Tailscale stream routes and resolves the prior streaming-path finding, but a redacted after-fix production trace is still the best availability proof before merge. Priority: P1 Review scores
Verification
How this fits togetherVoice-call gives Twilio a public webhook and WebSocket URL for audio. Tailscale must route each public path to the local voice-call server so realtime and streaming audio can connect after the webhook. flowchart LR
A[Twilio call] --> B[Voice-call webhook]
B --> C[Stream URL generation]
C --> D[Route resolver]
D --> E[Tailscale Serve or Funnel]
E --> F[Local WebSocket handler]
F --> G[Audio session]
Decision needed
Why: The checkout cannot access the operator's Twilio credentials or tailnet, so the required real-flow evidence threshold is a maintainer judgment rather than something this review can establish. Before merge
Agent review detailsSecurityNone. PR surfaceSource +140, Tests +448, Docs +2. Total +590 across 14 files. View PR surface stats
Review metrics
Merge-risk optionsMaintainer options:
Technical reviewBest possible solution: Retain the single route resolver and land after a redacted production trace verifies each supported audio mode, including a prefixed realtime webhook route, reaches its local handler through Tailscale. Do we have a high-confidence way to reproduce the issue? Yes, source provides a high-confidence reproduction: current main mounts only the webhook in both Tailscale paths while Twilio streaming and realtime publish separate WebSocket paths. A live carrier call was not rerun from this checkout. Is this the best way to solve the issue? Yes. One shared public-to-local route resolver is preferable to provider-specific URL rewrites: it matches the existing Twilio streaming URL and the realtime handler's public-prefix behavior across tunnel, direct setup, and CLI paths. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning high; reviewed against b1d5e78771f9. 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
HistoryReview history (2 earlier review cycles)
|
Preserve configured public Tailscale prefixes when mapping realtime and streaming routes, and roll back the full route set when any mount fails. The CLI now uses the same transactional setup path and reports failure instead of accepting a partial exposure.
Keep realtime routes under the public webhook prefix they advertise, while mounting streaming.streamPath exactly as Twilio emits it. This preserves the canonical public-to-local route list without expanding the provider API outside the scoped repair.
|
ClawSweeper final-head review handling for
|
|
Merged via squash.
|
…cale serve/funnel (openclaw#125468) * fix(voice-call): expose realtime/streaming stream paths through tailscale serve/funnel Tailscale serve/funnel now auto-exposes the realtime and streaming WebSocket stream paths when those audio modes are enabled; previously Twilio <Connect><Stream> could not reach wss://<ts-host><streamPath> and realtime calls dropped after ~1s with no log. Also: CLI voicecall expose mounts/clears stream paths symmetrically, partial tailscale mounts roll back on failure, and a warning now fires when a call's stream WebSocket never arrives within the token TTL. Reported/observed live by Peter Steinberger. * fix(voice-call): make tailscale stream exposure atomic Preserve configured public Tailscale prefixes when mapping realtime and streaming routes, and roll back the full route set when any mount fails. The CLI now uses the same transactional setup path and reports failure instead of accepting a partial exposure. * fix(voice-call): expose Twilio's configured streaming path Keep realtime routes under the public webhook prefix they advertise, while mounting streaming.streamPath exactly as Twilio emits it. This preserves the canonical public-to-local route list without expanding the provider API outside the scoped repair.
What Problem This Solves
Fixes an issue where operators using the voice-call plugin with Tailscale Serve or Funnel and realtime or streaming audio would see calls terminate after roughly one second because Twilio could not reach the advertised WebSocket stream path. The webhook path was exposed, but the realtime and streaming WebSocket paths were not, and the failure produced no gateway warning.
Why This Change Was Made
Voice-call now resolves enabled realtime and streaming exposure routes as public-to-local path pairs and uses that canonical set across runtime tunnel startup, direct Tailscale setup/cleanup, and
voicecall expose. Realtime routes preserve the public webhook prefix that the realtime handler advertises; streaming routes mount the configured path Twilio emits. Tailscale mounts are symmetric and transactional, and an unconnected realtime stream token emits a bounded warning after its 30-second TTL. ngrok remains unchanged because it exposes the whole local port.User Impact
Operators using Tailscale Serve or Funnel can now receive realtime and streaming voice calls without manually mounting extra WebSocket paths, including configurations where the public Tailscale webhook has an additional prefix. CLI exposure and cleanup cover the same paths, failed setup does not leave partial mounts behind or report false success, and a missing provider WebSocket connection is visible in logs instead of failing silently.
Evidence
extensions/voice-call/src/tunnel.ts:279and its Serve/Funnel dispatch atextensions/voice-call/src/tunnel.ts:371previously mounted only the webhook path; the direct runtime setup inextensions/voice-call/src/webhook/tailscale.ts:115likewise exposed only the webhook route. MeanwhileissueStreamSession()inextensions/voice-call/src/webhook/realtime-handler.ts:596advertisedwss://<host><streamPath>/<token>, leaving that path unreachable through Tailscale.tailscale funnel --bg --yes --set-path /voice/stream/realtime http://127.0.0.1:3334/voice/stream/realtimerestored working calls. The regression tests assert this exact public-to-local mount shape.providers/twilio.test.ts. These include pre-fix-failing regressions for realtime/streaming mounts, distinct public prefixes, the streaming path Twilio emits, path deduplication, partial-mount rollback, CLI failure reporting, symmetric cleanup, and the never-connected warning.node scripts/check-changed.mjspassed on the final head, including extension production/test typechecks, lint, dead exports, database-first, and import-cycle checks.173dc1af7f0d4345fb5d0f824645cd622b34763ddiff had a clean Codex-backed autoreview. Per the maintainer work order, review engines were not rerun after the ClawSweeper-directed follow-ups.173dc1af7f0d4345fb5d0f824645cd622b34763dwere applied: public prefixes are mapped to local realtime paths, direct setup rolls back atomically, andvoicecall exposeuses the same transactional result instead of reporting partial success.33ad5e0120be8ceb559d62cbb5e139fd67d8351freview's streaming-connectivity finding was applied by mountingstreaming.streamPathexactly as Twilio advertises it. Its optional rank-up moves to change Twilio provider output and add a new TwiML test were skipped becauseproviders/twilio.tsandproviders/twilio.test.tsare outside the work order's strict 14-file edit boundary; the existing provider suite was run, and the canonical resolver now makes its emitted URL reachable without adding a parallel provider mapping rule.