Skip to content

fix(voice-call): expose realtime/streaming stream paths through tailscale serve/funnel - #125468

Merged
steipete merged 3 commits into
mainfrom
steipete/nervous-thompson-5a286a
Aug 18, 2026
Merged

steipete merged 3 commits into
mainfrom
steipete/nervous-thompson-5a286a

Conversation

@steipete

@steipete steipete commented Aug 18, 2026 •

Copy link
Copy Markdown
Contributor

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

  • Root cause: the Tailscale tunnel branch in extensions/voice-call/src/tunnel.ts:279 and its Serve/Funnel dispatch at extensions/voice-call/src/tunnel.ts:371 previously mounted only the webhook path; the direct runtime setup in extensions/voice-call/src/webhook/tailscale.ts:115 likewise exposed only the webhook route. Meanwhile issueStreamSession() in extensions/voice-call/src/webhook/realtime-handler.ts:596 advertised wss://<host><streamPath>/<token>, leaving that path unreachable through Tailscale.
  • Live observation on 2026-08-17 on clawstudio: Twilio showed affected calls completing with 0-1 second duration and the gateway logged no stream-connection failure.
  • Live-proven manual workaround: tailscale funnel --bg --yes --set-path /voice/stream/realtime http://127.0.0.1:3334/voice/stream/realtime restored working calls. The regression tests assert this exact public-to-local mount shape.
  • Focused proof: 161 tests passed across the original six touched test files plus 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.mjs passed on the final head, including extension production/test typechecks, lint, dead exports, database-first, and import-cycle checks.
  • The initial 173dc1af7f0d4345fb5d0f824645cd622b34763d diff had a clean Codex-backed autoreview. Per the maintainer work order, review engines were not rerun after the ClawSweeper-directed follow-ups.
  • ClawSweeper findings on 173dc1af7f0d4345fb5d0f824645cd622b34763d were applied: public prefixes are mapped to local realtime paths, direct setup rolls back atomically, and voicecall expose uses the same transactional result instead of reporting partial success.
  • The 33ad5e0120be8ceb559d62cbb5e139fd67d8351f review's streaming-connectivity finding was applied by mounting streaming.streamPath exactly as Twilio advertises it. Its optional rank-up moves to change Twilio provider output and add a new TwiML test were skipped because providers/twilio.ts and providers/twilio.test.ts are 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.
  • Full live Twilio call E2E is infeasible from this development checkout because the Twilio credentials and tailnet are on the operator's production gateway. The mount argument shape is live-proven by the manual workaround above; this PR does not claim a full checkout-driven live call E2E.
  • Production LOC: +186/-46. The growth supplies the missing public-to-local stream exposure capability, one shared transactional route setup/rollback owner, and failure visibility for streams that never connect.

…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.
@clawsweeper

clawsweeper Bot commented Aug 18, 2026

Copy link
Copy Markdown
Contributor

🦞👀
ClawSweeper picked this up.

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

@openclaw-barnacle openclaw-barnacle Bot added docs Improvements or additions to documentation channel: voice-call Channel integration: voice-call size: L maintainer Maintainer-authored PR labels Aug 18, 2026
@steipete steipete self-assigned this Aug 18, 2026
@steipete
steipete marked this pull request as ready for review August 18, 2026 00:14
@clawsweeper clawsweeper Bot added merge-risk: 🚨 availability 🚨 May cause crashes, hangs, restart loops, stalls, or process outages. merge-risk: 🚨 compatibility 🚨 May break existing users, config, migrations, defaults, or upgrade paths. P1 High-priority user-facing bug, regression, or broken workflow. rating: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. status: ⏳ waiting on author ClawSweeper has contributor-facing work open and is waiting for author action. labels Aug 18, 2026
@clawsweeper

clawsweeper Bot commented Aug 18, 2026 •

Copy link
Copy Markdown
Contributor

Codex review: needs maintainer review before merge. Reviewed August 17, 2026, 9:03 PM ET / August 18, 2026, 01:03 UTC.

ClawSweeper review

What this changes

This 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 provenance

Possible regression — suspected (reviewed change). No predecessor PR is attributed.

Merge readiness

⚠️ Ready for maintainer review - 4 items remain

Keep 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
Reviewed head: 3643a0b722eca35b88c39d6047278304b57e00c0
Owner decision: Required. See Decision needed.

Review scores

Measure Result What it means
Overall readiness 🐚 platinum hermit (4/6) The implementation and focused coverage are solid; a maintainer should decide whether the remaining production-only trace gap is acceptable.
Proof confidence 🌊 off-meta tidepool Not applicable: This maintainer-authored PR is outside the external-contributor proof gate; its body documents a production workaround and why full local Twilio/Tailscale E2E is unavailable.
Patch quality 🐚 platinum hermit (4/6) No actionable review findings were identified.

Verification

Check Result Evidence
Real behavior Not applicable Not applicable: This maintainer-authored PR is outside the external-contributor proof gate; its body documents a production workaround and why full local Twilio/Tailscale E2E is unavailable.
Evidence reviewed 7 items Current-main gap: Current main's tunnel path invokes one Tailscale set-path command for the webhook only; it has no stream-route collection.
Direct Tailscale setup gap: Current main's legacy setup similarly configures only config.tailscale.path, so both supported Tailscale entry paths shared the omission.
Canonical route owner: The PR centralizes public-to-local route selection: realtime preserves the public webhook prefix, while streaming retains the configured path Twilio advertises.
Findings None None.
Security None None.

How this fits together

Voice-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]
Loading

Decision needed

Question Recommendation
Is the documented workaround plus focused command-level regression coverage enough to land this availability-sensitive voice-call fix, or should the PR include a redacted after-fix Twilio/Tailscale trace? Capture a redacted after-fix trace: Record a production call reaching the configured WebSocket route and include only redacted mount and connection evidence.

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

  • Resolve merge risk (P1) - No redacted after-fix Twilio/Tailscale trace is attached: the reported manual workaround proves equivalent mount arguments, but not this head against the production tailnet.
  • Resolve merge risk (P1) - Production changes are +186/-46 lines for a bug fix; the added route and rollback behavior is coherent, but it increases availability-sensitive surface area.
  • Complete next step (P2) - A maintainer must choose whether the documented production-only proof gap is acceptable, then exact-head CI can complete normally.
Agent review details

Security

None.

PR surface

Source +140, Tests +448, Docs +2. Total +590 across 14 files.

View PR surface stats
Area Files Added Removed Net
Source 6 186 46 +140
Tests 6 459 11 +448
Docs 2 3 1 +2
Config 0 0 0 0
Generated 0 0 0 0
Other 0 0 0 0
Total 14 648 58 +590

Review metrics

Metric Value Why it matters
Production versus tests production +186/-46; tests +459/-11; docs +3/-1 The positive production delta supplies a shared public-to-local route owner and rollback behavior; tests cover the route contracts across all callers.

Merge-risk options

Maintainer options:

  1. Capture a redacted production route trace (recommended)
    Before merge, show that Twilio connects through the new Tailscale mount for the configured audio mode.
  2. Accept command-level proof
    Merge with the focused route and rollback tests plus the documented workaround as the available evidence.

Technical review

Best 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.

Labels

Label changes:

  • add rating: 🐚 platinum hermit: Overall readiness is 🐚 platinum hermit; proof is 🌊 off-meta tidepool and patch quality is 🐚 platinum hermit.
  • add status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR. Not applicable: This maintainer-authored PR is outside the external-contributor proof gate; its body documents a production workaround and why full local Twilio/Tailscale E2E is unavailable.
  • remove rating: 🦐 gold shrimp: Current PR rating is rating: 🐚 platinum hermit, so this older rating label is no longer current.
  • remove status: ⏳ waiting on author: Current PR status label is status: 👀 ready for maintainer look.

Label justifications:

  • P1: A Tailscale-backed realtime or streaming call can terminate because the carrier cannot reach its advertised WebSocket path.
  • merge-risk: 🚨 compatibility: Existing Tailscale Serve/Funnel configurations gain additional mounted and cleanup paths, including prefixed public-route handling.
  • merge-risk: 🚨 availability: A failed additional route mount rolls back the route set, so proof of the real Tailscale configuration matters before landing.
  • rating: 🐚 platinum hermit: Overall readiness is 🐚 platinum hermit; proof is 🌊 off-meta tidepool and patch quality is 🐚 platinum hermit.
  • status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR. Not applicable: This maintainer-authored PR is outside the external-contributor proof gate; its body documents a production workaround and why full local Twilio/Tailscale E2E is unavailable.

Evidence

What I checked:

Likely related people:

  • steipete: Authored the current route repair and multiple historical voice-call/Tailscale changes, including restoration of voice-call plugin parity. (role: voice-call feature owner and recent area contributor; confidence: high; commits: 3643a0b722ec, 42c17adb5e4d; files: extensions/voice-call/src/config.ts, extensions/voice-call/src/tunnel.ts, extensions/voice-call/src/webhook/tailscale.ts)
  • Vincent Koc: History shows focused fixes and refactors around the same tunnel helper and Tailscale output handling. (role: recent adjacent Tailscale tunnel contributor; confidence: medium; commits: 47fdd6b88bac, 439a7732f478; files: extensions/voice-call/src/tunnel.ts, extensions/voice-call/src/webhook/tailscale.ts)

Rank-up moves

Optional improvements that raise the rating; they are not merge blockers.

  • Add a redacted after-fix Twilio/Tailscale connection trace if the maintainer selects the stronger proof option.

Rating scale

Score Internal tier Crab rank Meaning
6/6 S 🦀 challenger crab Exceptional readiness
5/6 A 🦞 diamond lobster Very strong readiness
4/6 B 🐚 platinum hermit Good normal PR; ordinary maintainer review
3/6 C 🦐 gold shrimp Useful, but confidence is limited
2/6 D 🦪 silver shellfish Proof or implementation needs work
1/6 F 🧂 unranked krab Not merge-ready
N/A NA 🌊 off-meta tidepool Rating does not apply

Overall follows the weaker of proof and patch quality.
Shiny media proof means a screenshot, video, or linked artifact directly shows the changed behavior. Runtime, network, CSP, and security claims still need visible diagnostics.

Workflow

  • ClawSweeper keeps one durable marker-backed review comment per issue or PR.
  • Re-runs edit this comment so the latest verdict, findings, and automation markers stay together instead of adding duplicate bot comments.
  • A fresh review can be triggered by eligible @clawsweeper re-review comments, exact-item GitHub events, scheduled/background review runs, or manual workflow dispatch.
  • PR/issue authors and users with repository write access can comment @clawsweeper re-review or @clawsweeper re-run on an open PR or issue to request a fresh review only.
  • Maintainers can also comment @clawsweeper review to request a fresh review only.
  • Fresh-review commands do not start repair, autofix, rebase, CI repair, or automerge.
  • Maintainer-only repair and merge flows require explicit commands such as @clawsweeper autofix, @clawsweeper automerge, @clawsweeper fix ci, or @clawsweeper address review.
  • Maintainers can comment @clawsweeper explain to ask for more context, or @clawsweeper stop to stop active automation.

History

Review history (2 earlier review cycles)
  • reviewed 2026-08-18T00:21:48.382Z sha 173dc1a :: found issues before merge. :: [P1] Map prefixed Tailscale stream routes | [P1] Roll back direct Tailscale setup after a stream mount fails | [P1] Report failed stream mounts from voicecall expose
  • reviewed 2026-08-18T00:45:44.441Z sha 33ad5e0 :: found issues before merge. :: [P1] Advertise the public streaming path to Twilio

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 clawsweeper Bot added rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR. and removed rating: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. status: ⏳ waiting on author ClawSweeper has contributor-facing work open and is waiting for author action. labels Aug 18, 2026
@steipete

Copy link
Copy Markdown
Contributor Author

ClawSweeper final-head review handling for 3643a0b722eca35b88c39d6047278304b57e00c0:

  • No actionable findings remain.
  • Rank-up move skipped: a redacted after-fix Twilio/Tailscale production trace cannot be captured from this development checkout because the Twilio credentials and tailnet live on the operator's production gateway.
  • Maintainer decision: accept the command-level proof option recorded in the review—the live-proven manual mount shape, 161 focused tests including the existing Twilio provider suite, green node scripts/check-changed.mjs, and green exact-head CI run 32086343684.

@steipete
steipete merged commit 1ca4103 into main Aug 18, 2026
172 checks passed
@steipete
steipete deleted the steipete/nervous-thompson-5a286a branch August 18, 2026 01:10
@steipete

Copy link
Copy Markdown
Contributor Author

Merged via squash.

github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Aug 18, 2026
…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.
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 maintainer Maintainer-authored PR merge-risk: 🚨 availability 🚨 May cause crashes, hangs, restart loops, stalls, or process outages. merge-risk: 🚨 compatibility 🚨 May break existing users, config, migrations, defaults, or upgrade paths. P1 High-priority user-facing bug, regression, or broken workflow. rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. size: L 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.

1 participant