Skip to content

feat(voice-call): add LiveKit SIP and native RTC provider - #170000

Open
evaldass wants to merge 21 commits into
openclaw:mainfrom
evaldass:feat/livekit-provider
Open

evaldass wants to merge 21 commits into
openclaw:mainfrom
evaldass:feat/livekit-provider

Conversation

@evaldass

@evaldass evaldass commented Oct 12, 2026 •

Copy link
Copy Markdown
Contributor

Related: #169991

What Problem This Solves

Operators who run telephony on LiveKit SIP cannot use Voice Call: it only accepts Twilio, Telnyx, Plivo, and mock carriers.

User Impact

Operators can select provider: "livekit" to place and receive phone calls over a LiveKit SIP trunk. Native RTC audio feeds the existing Voice Call realtime bridge, so model, voice, agent consultation, tools, call history, and playback stay with their current owners. Existing carriers are unchanged.

Supported:

  • Outbound calls on a selected outbound trunk. Each call gets a unique room, and the plugin correlates the exact SIP participant identity and SID before it publishes audio.
  • Signed inbound LiveKit webhooks for the selected inbound trunks. These use the existing inbound policy and caller allowlist.
  • Outbound-only operation (inboundPolicy: "disabled") with no public webhook or media WebSocket.
  • fromNumber as an E.164 number or, for LiveKit only, a 1–15 digit PBX extension. Targets and allowlists still require E.164, and other carriers still require an E.164 fromNumber.
  • wss:// by default. allowInsecureWs allows ws:// only to loopback or private literal IPs.

Not supported: classic STT/TTS mode, carrier XML notify playback, pre-connect DTMF and send_dtmf, and Twilio answering-machine detection. Restored calls are retired after a restart, not resumed. The Linux musl native binding is not supported.

New runtime dependencies: @livekit/rtc-node 1.1.0 (native) and livekit-server-sdk 2.19.1. These need maintainer dependency review.

Why This Change Was Made

The provider reuses the existing manager, realtime handler, and transcript owners instead of adding a separate LiveKit agent worker. Admission is rechecked immediately before the token-bearing RTC connect. Joined disposal persists final transcripts before the call terminates. Shutdown keeps manager finalization failures visible instead of reporting success after carrier cleanup.

Changes since the previously published head (42099fa)
  • Merged current main (6a6007663b3) to clear the new GitHub merge conflict. The new head is 1634010b66c, a normal merge commit on top of 42099fa with no rebase or history rewrite. All three conflicts were metadata only:
    • extensions/voice-call/package.json: took main's 2026.11.4 version and kept the two LiveKit dependencies and the description that names LiveKit.
    • Config baseline (counts.json, sha256): took main's files and regenerated with pnpm config:docs:gen; the plugin count is again +9 (5080 → 5089).
  • pnpm-lock.yaml merged without conflict. pnpm install --lockfile-only (pnpm 12.15.0) leaves the merged file byte-identical and the supply-chain policy check passes. Its delta against main is +206/−0 and is line-for-line the delta already published on 42099fa; no dependency version changed in this refresh.
  • The feature-code patch is unchanged from 42099fa. Comparing git diff da3cea2 42099fa with git diff 6a60076 1634010 (lockfile excluded) shows only the regenerated baseline hashes and counts. Feature code, tests, docs, tsdown.config.ts and the test-line allocation are unchanged.
  • Between the two bases, main changed two files this PR also touches, and both merged cleanly as main wrote them: the isProviderConfigured context pass-through in webhook.ts (improve(talk): live transcription uses a saved Deepgram, ElevenLabs or Mistral API key #199858) and the tsdown.config.ts build restructuring (perf(build): halve warm rebuilds with hook filters, parallel asset hooks, cache-hit fixes and an optional worker bundle #198664, improve(build): reduce runtime source retained by module loaders #196386), where the single @livekit/rtc-node external entry keeps its place. No plugin SDK subpath imported by the LiveKit files changed except provider-selection-runtime, whose only Voice Call caller is that webhook.ts line.
Earlier refresh (ae5340a → 42099fa)
  • Merged current main (da3cea2ce4a) to clear the new GitHub merge conflict. The new head is 42099fa42e8, a normal merge commit on top of ae5340a with no rebase or history rewrite. All four conflicts were metadata only:
    • extensions/voice-call/package.json: took main's 2026.11.1 version and kept the two LiveKit dependencies and the description that names LiveKit.
    • pnpm-lock.yaml: took main's lockfile and re-resolved it with pnpm 12.15.0 --lockfile-only. The supply-chain policy check passed. Compared with main it is still +206/−0 (LiveKit entries only). The one change from the earlier LiveKit delta is the transitive fast-copy 4.3.1 (was 4.2.0), pulled in through livekit-server-sdk → pino-pretty.
    • Config baseline: regenerated with pnpm config:docs:gen; the plugin count is again +9.
  • The feature-code patch is unchanged from ae5340a; metadata and lockfile resolutions are described above. Comparing git diff aeeff2c ae5340a with git diff da3cea2 42099fa (lockfile excluded) shows only the regenerated baseline hashes and counts and the version context line. Feature code, tests, docs, tsdown.config.ts and the test-line allocation are unchanged. Main's auto-merged Voice Call changes are kept as written: timer-probe cleanup (refactor(plugins): remove redundant native timer method probes #193309), Twilio listenAfterPlayback/turnToken (fix(voice-call): preserve Twilio greetings and resume listening after silence #193137), manifest starter prompts (feat(plugins): add short starter prompts with activation confirmation #193694), and the harness service apiVersion check (feat(plugins): reauthorize accepted session work #176886).
Earlier refresh (8278146 → 59eeeba → ae5340a)
  • Merged main (aeeff2c6340) to clear the GitHub merge conflict. This is a normal merge commit on top of 8278146, with no rebase or history rewrite. Conflicts:
    • extensions/voice-call/package.json: took main's 2026.10.10 version and kept the two LiveKit dependencies and the description that names LiveKit.
    • realtime-handler.ts: kept the extracted createRealtimeTelephonyBinding. Main's removal of the "idle monitor armed" log (fix(voice-call): end silent outbound realtime calls #191794) is ported into realtime-call-binding.ts, and that file's now-unused idleHangupMs parameter is dropped. Main's other realtime-handler changes auto-merged and are present: transcription language, transcript start timestamps, playback echo filtering, and greeting protection.
    • Config baseline: regenerated with pnpm config:docs:gen.
  • Compared with main, pnpm-lock.yaml is +206/−0 (LiveKit entries only). extensions/openai is unchanged, and fix(openai): voice calls fail when starting GPT-Live from plugin scope #189358 (181342878c0) is still an ancestor.
  • No feature code changed.
  • Hosted CI then exposed the new test-line budget gate: this PR adds exactly 2,529 test LF bytes against the captured base. Follow-up ae5340a adds only config/test-lines-allocations/livekit-voice-call-provider-170000.txt, using the documented per-change allocation mechanism. The record explains the SIP/RTC admission, native audio, joined cleanup and compiled-package regression coverage. The shared baseline scalar, assertions, timeouts and production/build/dependency bytes are unchanged. The staged ratchet passes with 25 lines of headroom; this is not a blanket exception or a claim that the earlier failed hosted run passed.

Evidence

Focused source checks used local offline fixtures. No phone calls, inference sessions or production credentials were involved.

Source head: 1634010b66c058159a86512d1db4cc8a90570c0d, which merges main 6a6007663b36db8badd6967e7f2bed5c6b3a724e into the previously published 42099fa42e8fb11b963a845848b4542bd2e0a92c. Pinned pnpm 12.15.0 frozen install. Local checks ran serially on a shared 9.9 GiB Linux host inside a task-owned cgroup capped at 3 GiB RAM, 1 GiB swap and two CPUs, so that no check could disturb other processes on the host.

Not run locally on this head; exact-head hosted CI is required for each:

  • Voice Call tests and the LiveKit packaging test. Every run through the repository test runner first builds the runner's compiled test workers, and that build exceeded the 3 GiB cap and was stopped inside the cgroup before any test executed. No Voice Call test result exists for this head yet.
  • tsgo:extensions:test, type-aware oxlint on the changed Voice Call files, and the extension package-boundary compile. The first two exceeded the cap; the third was not attempted.
  • The database-worker and database-dialect ratchets (native TypeScript inventory). Not attempted here; the PR's only SQLite use is a synthetic node:sqlite reopen inside a test file.

Passed locally on this head:

  • tsgo:extensions (production typecheck of all extensions against the new base).
  • Ratchets against 6a60076: max-lines (including the env-var budget), line-cap (27 changed source files), assertion-safety, session-identity, timeout-race, mock-exports. Test lines pass: net +2,529, covered by the existing 2,529-line allocation record.
  • Config docs baseline check and plugin inventory check.
  • Guards: import cycles (0), the three extension and three plugin import-boundary guards, and conflict markers.
  • Format on the 30 changed formattable files, docs MDX on the 3 changed docs, config-example check, and git diff --check.
Earlier head 42099fa (historical, not claimed for the current head)

Tested source head at that time: 42099fa42e8fb11b963a845848b4542bd2e0a92c, which merges main da3cea2ce4a280ac6acc89b62693a19c6534f68d into the previously published ae5340a0e49c8c3fb999df9b0dc55f0603fa94a4. Pinned pnpm 12.15.0 frozen install. Checks ran serially on a shared 16-core / 9.9 GiB Linux host.

  • Voice Call: 756 tests in 56 files pass, plus 182 tests in 15 files in the database-workers shard.
  • LiveKit packaging test (test/scripts/tsdown-livekit-packaging.test.ts): 3 of 3 pass. The cold verbose=0 build took 8.7 s.
  • Typecheck:
    • tsgo:extensions and tsgo:extensions:test pass.
    • The extension package-boundary compile passes using CI's PR selection against da3cea2. That selection is codex, slack, telegram and voice-call.
  • Lint: scoped type-aware oxlint on extensions/voice-call passes.
  • Ratchets: check:baseline-ratchets --base da3cea2 runs line-cap, max-lines (including the env-var budget), assertion-safety, database-dialect, timeout-race, mock-exports, config docs and plugin inventory. All of them pass. Test lines also pass: 6,585,292 against a ceiling of 6,585,292, so the existing 2,529-line allocation is still exact.
  • The SQLite database-worker ratchet did not complete locally. Its native TypeScript inventory child was OOM-killed on this 9.9 GiB host, in repeated attempts. This local gap is now covered by the successful exact-head hosted checks-fast-baseline-ratchets job in CI run 42508135014; no local retry or bypass was used. The PR's only SQLite use is a synthetic node:sqlite reopen inside a test file.
  • Guards: import cycles (0), the extension and plugin import-boundary guards, and conflict markers pass.
  • Changed files pass format and the docs MDX and config-example checks.
  • tsgo:test:root fails with 57 errors, all inherited from main:
    • A clean main worktree at da3cea2 with its own frozen install gives the same 57 errors, line for line.
    • None of the 43 failing files are in this PR's diff.
  • No compiled build, installed package or private-lab run exists for 42099fa. The compiled and lab evidence below was produced on the earlier 59eeeba artifact. It is kept for history and is not claimed for this head.
  • No compiled build, installed package or private-lab run exists for 1634010. The compiled and lab evidence below was produced on the earlier 59eeeba artifact. It is kept for history and is not claimed for this head.

Earlier evidence: compiled package and private-lab runtime for 59eeeba (not the current head)

  • Maintained complete-host packager, selected voice-call: exit 0, 596.90 seconds, peak RSS 3,104,784,384 bytes; tarball integrity passed. Source stayed clean and manifests/lock unchanged. Control UI performance diagnostics were advisory; this is not independent performance qualification.
  • Archive SHA-256: 78bffb1b6a3bf4c59d8a4521275520be53d0f7c7ec36305815a3e426bc59d3d1. Original build ID: 2026.10.10-59eeeba60a54-2026-11-04T21-07-33.125Z.
  • Ordinary fresh-prefix Linux install succeeded (402 packages, 31 seconds). All 16,992 installed dist files exactly match the original archive, with zero mismatches or unexpected files.
  • Compiled plugin loaded with origin: bundled, trust bundled; initialized durable state, readiness ready:true / failing:[], empty active-call and room inventories.
  • The actual compiled consumer's public native SDK import supplies all nine consumed exports and the destination Linux GNU binding. A real AudioSource captured 1,280 PCM samples, queued 158 ms, and closed with awaited disposal.
  • Actual private SIP/RTP, not agent speech: local generated fixture received INVITE, sent 200, received ACK and BYE, with bidirectional RTP counters (13 packets sent, 11 received in the private-WS attempt). Native RTC attachment reached realtime-provider registration, which failed because the isolated runtime cannot resolve its protected OpenAI credential binding. No functioning model session, audible assistant speech or recognition is claimed. A generated test-certificate native TLS failure was separately identified; only this isolated loopback lab uses the provider's explicit private-WS opt-in, with no global TLS or external-policy change.
  • Actual late-answer cancellation: the installed public end operation succeeded before the fixture's eight-second delayed answer; late 200/ACK/BYE were observed, with zero RTP received by the fixture. After settlement there were zero active calls and zero rooms. This proves observed cancellation/cleanup, not complete late token-bearing I/O or consultation isolation.
  • A genuine failed call from this artifact reopened through the public read-only CLI in a separate process after Gateway shutdown; all eight runtime-summary fields matched its richer durable record. This is current-candidate failed-call persistence, not stable carrier-history migration.
  • Gateway logged clean shutdown in 117 ms after the failed transport/admission and cancellation attempts, but the launcher reported SIGTERM rather than exit 0. This is not successful post-conversation shutdown acceptance. All owned lab resources, processes and listener ports were cleaned up.
  • Supported configuration upgrade: an integrity-verified official 2026.10.9 prefix was normally upgraded to the exact 59eeeba archive. The unchanged config initially failed public CLI admission on legacy agents.defaults.heartbeat; the documented doctor --fix --yes --non-interactive --no-workspace-suggestions migration (not a manual deletion) completed with exit 0. It removed the legacy disabled heartbeat setting and performed ordinary Doctor metadata/agent/skill housekeeping. The original workspace marker and config validation then passed in separate clean-environment processes; 46 mirrored receipts verify by checksum. Exact main already owns this migration; the carrier has no config/Doctor source delta from that parent. This proves the previous-release configuration update path with Doctor, not current-latest stable carrier-history migration. npm latest is now 2026.10.10, whose older official build has a different pre-Doctor contract despite the same version label. No synthetic SQLite history or successful model/consult response was injected.

Private operator testing (summary only):

  • The earlier full attempt reached the handset but failed immediately during GPT-Live startup. Later allowlisted diagnostics identified DataCloneError at media-worker construction, not a SIP delivery failure. The shared fix is fix(openai): voice calls fail when starting GPT-Live from plugin scope #189358, merged into main and now included through this merge.
  • On local integration candidate 3488f3f09731c1e1c0f83e9ce7ab7f080b0f70be, a short two-way conversation completed normally for about 89 seconds. That candidate contained carrier head 9163172, the fix(openai): voice calls fail when starting GPT-Live from plugin scope #189358 fix, and temporary startup diagnostics. The caller confirmed clear speech and replies. Caller and assistant aggregate finals survived reopening the durable store. This human-confirmed conversation proof is for that candidate only. None of 8278146, 59eeeba or 42099fa has a human-confirmed conversation result, and this PR does not claim to fix the separately investigated silent-call/startup issue. The narrower real private-lab SIP/RTP attempts on 59eeeba are described above. The historical conversation is not current installed-package, inbound, isolation, consultation, upgrade or production acceptance.
  • Room, process, and port cleanup was verified, but that call runtime needed a forced stop. The separate shutdown repair, fix(process): Gateway shutdown fails when broker groups retain zombies #189415, is still open and not merged, and this PR does not include it.
Event log from the recorded call on candidate 3488f3f (redacted)

This projection keeps the event timestamps and types from the original Gateway JSONL log. Session IDs are replaced with consistent aliases, and all utterances, endpoints, and credentials are removed.

{"time":"2026-10-31T11:53:41.875Z","session":"CALL_A","event":"session.started","provider":"openai","transport":"gateway-relay"}
{"time":"2026-10-31T11:53:44.728Z","session":"CALL_A","event":"session.ready","provider":"openai","transport":"gateway-relay"}
{"time":"2026-10-31T11:53:46.008Z","session":"CALL_A","event":"output.audio.started","provider":"openai","transport":"gateway-relay"}
{"time":"2026-10-31T11:55:11.056Z","session":"CALL_A","event":"input.audio.committed","provider":"openai","transport":"gateway-relay","final":true}
{"time":"2026-10-31T11:55:11.060Z","session":"CALL_A","event":"output.audio.done","provider":"openai","transport":"gateway-relay","final":true}
{"time":"2026-10-31T11:55:11.061Z","session":"CALL_A","event":"session.closed","provider":"openai","transport":"gateway-relay","final":true}

The call ended completed after 89,344 ms. Both caller and assistant aggregate finals were saved, and reopening the durable store confirmed them (quick_check=ok). Aggregate callback timestamps do not show per-turn latency.

Open before merge

  • Maintainer decision: bundled carrier vs. an external carrier contract, plus dependency approval for the two LiveKit packages. ci-gate and dependency-review are waiting on this. The author is not requesting or issuing that approval.
  • Remaining live and installed acceptance, not satisfied by the narrower observations above:
    • installed-package SIP ↔ RTC audio, showing an unselected peer rejected before audio or consultation, and retirement blocking later RTC I/O
    • delayed agent consultation
    • joined graceful shutdown after a real call
    • upgrade from the latest stable release with existing carrier settings and call history
  • Shared prerequisites outside this PR:
  • The isolated model/audio/consultation acceptance is blocked on an owner-authorized usable protected credential binding; supported environment SecretRef activation currently fails before model dispatch. No secret was copied, auth boundary weakened, or alternate provider/model selected.
  • Exact-head technical CI for 1634010 has not run yet. It must cover the Voice Call tests, the LiveKit packaging test, the extension test typecheck, lint, the package-boundary compile and the database ratchets listed under Evidence as not run locally. The new head also needs its own maintainer approval and dependency review; the lockfile delta is unchanged from 42099fa.
  • Earlier head: exact-head technical CI for 42099fa completed successfully: run 42508135014, including checks-fast-baseline-ratchets. No job failed or was cancelled in that technical workflow. This covers the local database-worker ratchet resource gap. Separate maintainer admission still blocks merging; technical CI success does not grant dependency approval. The older CI results below remain historical.
  • Hosted CI at 59eeeba found the missing per-change test allocation; that original failure remains disclosed. On the earlier head ae5340a, technical CI is terminal: 65 CheckRuns succeeded, 67 skipped, 1 neutral, zero failures/cancellations/timeouts/in-progress. Both checks-fast-baseline-ratchets and the technical workflow job named openclaw/ci-gate succeeded; Darwin tooling succeeded too. Skipped and neutral checks are not counted as passing tests. The separate admission workflow completed its resolution/review jobs successfully, but the status contexts openclaw/ci-gate (failure) and openclaw/dependency-review (pending) still explicitly require a maintainer to approve this revision. They are not technical test failures and were not bypassed. The new head 42099fa needs its own maintainer approval, including dependency review of the re-resolved transitive [email protected].
  • No canonical autoreview has run on 1634010 or on 42099fa. For 42099fa: An independent parent review of the final committed tree verified the four metadata merge resolutions, unchanged feature-patch bytes, exact tested-tree identity, clean worktree, dependency delta, preserved upstream changes, terminal focused-test logs and the exact-main root-typecheck comparison. No refresh-specific actionable finding was identified; this is not a full independent re-review of the original carrier implementation. Earlier, an independent parent review inspected the 59eeeba merge resolutions, dependency and package scope, preserved upstream behavior, and terminal verification logs, and identified no actionable refresh-specific findings. None of this is a canonical autoreview or a complete independent re-review of the original carrier implementation.

Status unchanged: ready for review, not ready to merge.

Refresh review

An independent parent review checked this exact committed range against main 6a6007663b3, the merge resolutions, preserved upstream owners and terminal verification logs. The carrier feature and dependency patch was independently compared with the previous published range and remains unchanged. For the shutdown repair, the parent also reran the real-process fixture on 9ef4c65 under a task-owned memory cgroup: it settled in 460 ms while the adopted child was a zombie, with all four fixture checks passing. This is a focused refresh review, not a canonical autoreview, not full original-feature re-review, and not a current installed Gateway or conversation proof. The disclosed missing Vitest / resource-limited checks still require exact-head hosted CI.

@clawsweeper

clawsweeper Bot commented Oct 12, 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 docs Improvements or additions to documentation channel: voice-call Channel integration: voice-call size: XL labels Oct 12, 2026
@clawsweeper clawsweeper Bot added P3 Low-priority cleanup, docs, polish, ergonomics, or speculative work. merge-risk: 🚨 security-boundary 🚨 May affect sandboxing, authorization, credentials, or sensitive data. rating: 🧂 unranked krab Not merge-ready due to missing proof or serious correctness/safety concerns. status: 📣 needs proof The PR needs real behavior proof before ClawSweeper can clear the contributor ask. labels Oct 12, 2026
@clawsweeper

clawsweeper Bot commented Oct 12, 2026 •

Copy link
Copy Markdown
Contributor

Codex review: needs real behavior proof before merge.

What this changes

Adds LiveKit SIP calling and native RTC audio to the existing Voice Call plugin.

Example: An operator uses LiveKit trunk ST_OUTBOUND with caller extension 1001 to call +15550000002.

  • Before: Voice Call rejects livekit as an unsupported carrier.
  • After: The proposed provider creates an isolated SIP room and attaches its audio to the existing realtime bridge.

Review scores

Measure Result What it means
Overall readiness 🦪 silver shellfish (2/6) The implementation has substantial lifecycle coverage and useful installed transport evidence, but central acceptance is incomplete and the authority boundary lacks final-effect proof.
Proof confidence 🦪 silver shellfish (2/6) Real behavior proof is necessary before merge. See Before merge.
Patch quality 🦐 gold shrimp (3/6) No actionable review findings were identified.

Product

Kind: Feature · Worth it: Needs a maintainer decision · Fix scope: Complete
User problem: Operators using LiveKit SIP cannot connect that carrier to Voice Call while retaining its existing conversation, consultation, and history owners.
Reason: There is concrete integration value and no equivalent current carrier API, but bundled placement and the new configuration surface have no recorded maintainer sponsorship.

Merge readiness

⛔ Blocked before merge - 4 items remain

Keep this PR open: it contains meaningful carrier integration work absent from main, and its paired feature request remains unresolved; bundled ownership still needs a maintainer decision.

Priority: P3
Reviewed head: ae5340a0e49c8c3fb999df9b0dc55f0603fa94a4
Owner decision: Required. See Decision needed.

Decision needed

  • Question: Should LiveKit ship inside bundled Voice Call, or should a public carrier/audio contract support an externally maintained adapter?
  • Recommendation: Define an external carrier contract: Use this implementation to identify the smallest carrier/audio seam, preserve existing owners, and maintain LiveKit externally.
  • Why: The integration is coherent, but neither this PR nor its paired issue records maintainer acceptance of bundled scope, and current public APIs cannot express equivalent carrier reuse.

Before merge

  • Add real behavior proof - Authority-chain proof required: The installed 59eeeba artifact demonstrates native SDK loading, SIP/RTP, and late-answer cancellation, and its production inputs match this head. Model credential admission prevented a functioning current-artifact conversation; the historical 3488f3f conversation does not establish current acceptance. Supply redacted logs or terminal evidence showing an allowed caller conversing and consulting, an unselected peer rejected before audio or consultation, retirement blocking later token-bearing RTC I/O and consultation, and joined shutdown after a real call; redact IPs, keys, phone numbers, and non-public endpoints. After adding proof, update the PR body, then request a new review with @clawsweeper re-review. The PR author or someone with repository write access can request it.
  • Resolve merge risk - Before merge, the contributor must establish that the new room-to-agent authority boundary excludes unselected SIP peers and retired calls at final audio and consultation effects.
  • Await maintainer action - A maintainer must review and approve the LiveKit dependency graph for ae5340a before the enforced dependency gate can clear.
  • Add data-model compatibility proof - The review found that existing stored data may not work after upgrade. Show that existing data still loads and works with this change.

Findings

None.

Tests

  • Missing end-to-end proof: Complete installed SIP/RTC conversation, delayed consultation, forbidden-peer and retired-call isolation, joined shutdown, and latest-stable upgrade with existing carrier settings and history.
Agent review details

How this fits together

The carrier adapter translates signed SIP events and native RTC audio into Voice Call manager events and realtime transport operations; existing owners retain model selection, consultation, transcripts, and call termination.

flowchart LR
  A[Phone caller] <--> B[LiveKit SIP room]
  B <--> C[LiveKit carrier adapter]
  C <--> D[Voice Call manager]
  C <--> E[Realtime handler]
  E <--> F[Voice model and consultation]
  D --> G[Call history]
Loading

Technical review

Best possible solution:

Choose the carrier ownership boundary, retain existing call and realtime owners, and complete acceptance for the agreed integration.

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

Source confirms that main lacks LiveKit carrier selection and an external carrier attachment contract; this is a new capability request rather than a reproducible promised-behavior failure.

Is this the best way to solve the issue?

The SIP and native-audio adapters reuse the appropriate manager and realtime owners, and the lifecycle extraction supports joined disposal; whether that implementation belongs bundled remains a product choice.

AGENTS.md: found and applied where relevant.

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

Merge-risk options

Maintainer options:

  1. Prove final-effect isolation (recommended)
    The contributor supplies allowed-peer, forbidden-peer, and retired-call evidence through the real carrier/audio owners before merge.
  2. Pause carrier integration
    Keep the implementation available for scope review while the required isolated acceptance environment is unavailable.

Provenance checked

  • Realtime teardown and terminal ownership keeps the original intent (5e3e524: Preserve provider-confirmed termination and keep carrier hangup and terminal persistence under the call manager; earlier socket-bound teardown also prevents predecessor closures from ending successor calls.)
  • Inbound callback admission keeps the original intent (9fa2a21: Permit callbacks from recently called numbers while retaining existing inbound policy; the patch preserves this behavior and limits its additional capacity check to LiveKit.)
  • Outbound setup failure finalization changes intended behavior with a stated reason (ce7981f: Await durable lifecycle decisions before publishing state; the patch explains why a failed final-transcript drain must retain its active manager record instead of being finalized by the generic setup-error catch.)
  • Webhook verification and parsing keeps the original intent (1aadf26: Bind webhook replay handling to verified request identity; asynchronous LiveKit verification retains signed-body validation and the existing replay reservation owner.)

Testing

Proof path: shipped entry point.

Security

None.

Evidence

What I checked:

PR surface

Source +1511, Tests +2529, Docs +62, Config +2, Generated 0, Other +216. Total +4320 across 36 files. Added test files: 8.

View PR surface stats
Area Files Added Removed Net
Source 16 1697 186 +1511
Tests 11 2530 1 +2529
Docs 3 68 6 +62
Config 1 3 1 +2
Generated 2 3 3 0
Other 3 216 0 +216
Total 36 4517 197 +4320

Review metrics

Metric Value Why it matters
New configuration surface 7 LiveKit settings and 1 carrier selection The optional carrier introduces credentials, endpoint, trunk selection, room naming, and an insecure-private-network opt-in that need an explicit product decision.

Labels

Label changes:

  • add merge-risk: 🚨 security-boundary: Room tokens and SIP participant identity now authorize audio and agent consultation, while final-effect rejection of forbidden peers and retired calls remains unproven.
  • add rating: 🦪 silver shellfish: Overall readiness is 🦪 silver shellfish; proof is 🦪 silver shellfish and patch quality is 🦐 gold shrimp.
  • add status: 📣 needs proof: The PR needs real behavior proof before ClawSweeper can clear the contributor ask.

Label justifications:

  • P3: This adds an optional carrier capability without establishing a regression in an existing supported workflow.
  • merge-risk: 🚨 security-boundary: Room tokens and SIP participant identity now authorize audio and agent consultation, while final-effect rejection of forbidden peers and retired calls remains unproven.
  • rating: 🦪 silver shellfish: Overall readiness is 🦪 silver shellfish; proof is 🦪 silver shellfish and patch quality is 🦐 gold shrimp.
  • status: 📣 needs proof: The PR needs real behavior proof before ClawSweeper can clear the contributor ask.

Rank-up moves

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

  • Demonstrate allowed and forbidden SIP peers and retired-call rejection before final RTC audio and agent consultation effects.
  • Complete current-artifact conversation, delayed consultation, and graceful shutdown acceptance.
  • Upgrade from the latest stable release with existing carrier settings and call history preserved.

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.

History

Review history (4 earlier review cycles)
  • reviewed 2026-10-12T16:20:00.351Z sha 8bbd80c :: needs real behavior proof before merge. :: [P2] Check current admission before connecting the RTC room
  • reviewed 2026-10-13T07:43:51.740Z sha 0b6b04c :: needs real behavior proof before merge. :: none
  • reviewed 2026-10-13T08:35:44.632Z sha 0b6b04c :: needs real behavior proof before merge. :: [P2] Extract coherent handler code to satisfy the line-cap ratchet | [P2] Move the LiveKit webhook scenario into a sibling test suite
  • reviewed 2026-10-31T15:23:34.072Z sha 9163172 :: needs real behavior proof before merge. :: none

Reviewed November 4, 2026, 4:59 PM ET / 21:59 UTC (Revision 5).

@evaldass
evaldass marked this pull request as ready for review October 13, 2026 08:25
@github-actions github-actions Bot added the dependencies-changed PR changes dependency-related files label Oct 13, 2026
@github-actions

github-actions Bot commented Oct 13, 2026 •

Copy link
Copy Markdown
Contributor

⚠️ Dependency review required

This PR changes the dependency graph. A repository admin or an active member of @openclaw/openclaw-secops must review these changes before merging.

Current SHA: 156f9cee6d56fbc667b4f09ee07230213d9f7f10

These dependency graph changes were made:

  • pnpm-lock.yaml
  • extensions/voice-call/package.json

Auto-scrub was not attempted because this PR changes package manifest dependency graph fields:

  • extensions/voice-call/package.json

Dependency graph changes require maintainer review. Please remove lockfile changes manually if they are not needed.

To remove lockfile changes, restore them from this PR's merge base:

git fetch 'https://github.com/openclaw/openclaw.git' 'main'
git restore --source="$(git merge-base HEAD FETCH_HEAD)" --staged --worktree -- 'pnpm-lock.yaml'
git commit -m 'chore: remove dependency lockfile change'
git push

After reviewing the changes, post a new PR comment containing only approval commands, each on its own line:

/allow-dependencies-change

A later push requires a fresh approval comment.

@evaldass

Copy link
Copy Markdown
Contributor Author

The P2 connection-admission defect is fixed in b7634a6 and retained in current head 0b6b04c. The PR body now includes the observed baseline failure (one token-bearing connect in both retirement cases), repaired zero-connect outcome, exact-head 257-test/15-file results, independent scoped review, and explicit remaining proof/placement gates. The requested private-Set test was removed. The actual main manifest conflict was resolved without rewriting the published branch; frozen-lock installation passed. Marked ready for review to request maintainer discussion, not as a merge-readiness claim. Bundled-versus-external ownership and installed/live isolation, delayed consultation, and stable-upgrade acceptance remain open; no private call data is published.

@clawsweeper re-review

@clawsweeper

clawsweeper Bot commented Oct 13, 2026 •

Copy link
Copy Markdown
Contributor

🦞👀
Exact review queued.

Re-review progress:

@evaldass

Copy link
Copy Markdown
Contributor Author

Author-owned CI findings are addressed on current head 8df609761f686e63a60648105991fe2069a56b8f: the handler/webhook line-cap growth, import cycle, config baseline, typed-lint diagnostic, and mock-export declarations are repaired without widening guards. The PR body contains exact test and CI evidence. Current GitHub status now blocks on maintainer dependency review (@livekit/rtc-node and livekit-server-sdk); I have not self-issued an approval command. Could a maintainer please decide the bundled-versus-external carrier boundary and, if this bundled direction is acceptable, review/approve the current dependency revision so ordinary CI can proceed?

evaldass and others added 5 commits October 25, 2026 16:48
Merge a830e2e into the LiveKit provider branch. Adapt the RTC binding
to StreamDisconnectGrace, inline host speech and end-call handling, and
regenerate the config baseline and lockfile with the maintained tools.

Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
…audio

- stop() retries/rejects manager terminal persistence failures after carrier
  disposal, including retained terminal rooms with an active manager record.
- Cancelled outbound admission with a failed final drain no longer gets
  terminalized as failed by the generic dial catch (typed
  ProviderSetupDurabilityError).
- Track active audio readers per SID with exact-owner retirement so a
  resubscribed track is read again.

Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
Resolve conflicts with current main: adopt the inline webhook exposure
config type and real config owners in runtime tests, keep LiveKit
dependencies on the current package version, and regenerate the lockfile
and config baseline with the pinned pnpm.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
JavaScript and JSON Schema `$` already reject a trailing newline, so the
extra end-of-input lookahead was redundant. Use synthetic extension
fixtures in the regressions.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
evaldass and others added 2 commits October 30, 2026 11:53
- Let shutdown disposal reject directly instead of rethrowing an unknown.
- Mark the end-call tool's binding close as handled; completion tracking
  already reports close failures.
- Realtime providers redact connect errors, so the connect-failure log now
  records whether the carrier session had already closed. This separates a
  LiveKit-side abort from a model relay failure without logging error content.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
@evaldass

Copy link
Copy Markdown
Contributor Author

Updated the durable PR body with inspectable, redacted session.ready / audio / closure output from the previously reported integration run, its exact candidate and external prerequisite #189358, and the separate shutdown repair #189415. Selected technical CI on this carrier head is successful; dependency admission still needs a maintainer decision on the bundled carrier scope and current native/server SDK additions. No new phone call or approval bypass was performed.

@clawsweeper re-review

@clawsweeper

clawsweeper Bot commented Oct 31, 2026 •

Copy link
Copy Markdown
Contributor

🦞👀
Exact review queued.

Re-review progress:

@clawsweeper clawsweeper Bot added clawsweeper:intake:feature Preliminary submission classification; full source review pending. rating: 🦪 silver shellfish Thin PR readiness signal; proof, validation, or implementation needs work. and removed rating: 🧂 unranked krab Not merge-ready due to missing proof or serious correctness/safety concerns. clawsweeper:intake:feature Preliminary submission classification; full source review pending. labels Oct 31, 2026
Resolve conflicts with main c5b56f2:
- voice-call package.json/pnpm-lock: keep LiveKit SDK deps, take typebox 1.4.3
  and jose 6.2.13 from main; jose 5.10.0 stays for livekit-server-sdk.
- runtime.test.ts: keep the LiveKit lifecycle double and main's guarded
  Twilio request mock side by side.
- config baseline: regenerated with pnpm config:docs:gen.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
@clawsweeper clawsweeper Bot removed rating: 🦪 silver shellfish Thin PR readiness signal; proof, validation, or implementation needs work. merge-risk: 🚨 security-boundary 🚨 May affect sandboxing, authorization, credentials, or sensitive data. status: 📣 needs proof The PR needs real behavior proof before ClawSweeper can clear the contributor ask. labels Nov 2, 2026
Resolve conflicts with origin/main aeeff2c:
- voice-call package.json: take 2026.10.10 version, keep LiveKit deps
  and description.
- realtime-handler.ts: keep the extracted createRealtimeTelephonyBinding;
  port main's removal of the idle-monitor armed log (openclaw#191794) into
  realtime-call-binding.ts and drop its now-unused idleHangupMs param.
- config baseline counts/sha256: regenerated with config:docs:gen.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
@socket-security

Copy link
Copy Markdown

Review the following changes in direct dependencies. Learn more about Socket for GitHub.

Diff Package Supply Chain
Security
Vulnerability Quality Maintenance License
Addednpm/​livekit-server-sdk@​2.19.19910010093100
Addednpm/​@​livekit/​rtc-node@​1.1.010010010099100

View full report

Record exactly 2529 new test LF bytes against captured main for SIP/RTC admission, native audio, joined teardown and compiled-package boundaries. Use the documented per-change allocation mechanism; leave the shared baseline, test timeouts, assertions and production inputs unchanged.
@evaldass

evaldass commented Nov 4, 2026

Copy link
Copy Markdown
Contributor Author

Refreshed this existing PR onto current main and updated the durable body with exact source checks, the measured per-change test-line allocation repair, and inspectable complete-package / normal-install / private-lab transport evidence. Current head is ae5340a0e49c8c3fb999df9b0dc55f0603fa94a4; the built artifact remains explicitly attributed to 59eeeba (the follow-up changes only the allocation record). The body preserves the protected model-credential binding, full conversation/consult/isolation/history acceptance, and maintainer scope/dependency gaps rather than claiming they passed. Supported previous-release configuration migration through Doctor is now evidenced separately.

@clawsweeper re-review

@clawsweeper

clawsweeper Bot commented Nov 4, 2026 •

Copy link
Copy Markdown
Contributor

🦞👀
Exact review queued.

Re-review progress:

Merge main da3cea2 into feat/livekit-provider (ae5340a).

Conflicts resolved:
- extensions/voice-call/package.json: main's 2026.11.1 version, keep the
  LiveKit description and dependencies.
- pnpm-lock.yaml: main's lockfile re-resolved with pnpm 12.15.0
  --lockfile-only; +206/-0 versus main, LiveKit entries only.
- docs/.generated config baseline: regenerated with config:docs:gen.
Merge main 6a60076 into the published head 42099fa.

Conflicts were metadata only:
- extensions/voice-call/package.json: main's version 2026.11.4 with the
  LiveKit description and dependencies kept.
- docs/.generated/config-baseline.{counts.json,sha256}: main's files,
  regenerated with pnpm config:docs:gen (plugin 5080 -> 5089).

pnpm-lock.yaml merged cleanly; pnpm install --lockfile-only leaves it
unchanged and its delta against main is the previously reviewed +206
LiveKit lines.
@openclaw-barnacle

Copy link
Copy Markdown

This pull request has been automatically marked as stale after 7 days without qualifying human activity.
Without new human activity, Barnacle may close it as not planned 7 days after this message was posted. This is administrative inactivity cleanup, not a claim that the problem is fixed.
A human update restarts the inactivity clock; a new PR head also restarts it. A maintainer can add no-stale for a durable hold, or bad-barnacle to suppress Barnacle. Remove the hold when work can resume.

@openclaw-barnacle openclaw-barnacle Bot added the stale Marked as stale due to inactivity label Nov 24, 2026
Preserve the upstream Twilio stream admission flow and attach LiveKit RTC only to its already-admitted manager call. Retain the current plugin version and regenerate the config baseline.
@openclaw-barnacle openclaw-barnacle Bot removed the stale Marked as stale due to inactivity label Nov 28, 2026

This branch has not been deployed

No deployments
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 dependencies-changed PR changes dependency-related files docs Improvements or additions to documentation P3 Low-priority cleanup, docs, polish, ergonomics, or speculative work. size: XL

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant