Skip to content

fix(voice-call): bind realtime streams to signed calls - #136506

Merged
drobison00 merged 4 commits into
openclaw:mainfrom
drobison00:fix/fix-989
Nov 19, 2026
Merged

drobison00 merged 4 commits into
openclaw:mainfrom
drobison00:fix/fix-989

Conversation

@drobison00

@drobison00 drobison00 commented Sep 2, 2026 •

Copy link
Copy Markdown
Contributor

What Problem This Solves

Twilio realtime stream startup could associate a WebSocket with a call identity different from the signature-verified webhook request that generated its TwiML. A signed webhook with an absent or whitespace-only CallSid could also mint an unbound one-time stream URL.

Why This Change Was Made

The TwiML path now trims and requires the signature-verified CallSid before any <Stream> response or one-time stream session is issued. A missing or blank signed CallSid receives the existing non-disclosing rejection response. Valid Twilio stream metadata always carries the bound call identity, so the WebSocket start-frame comparison is unconditional. Telnyx retains its existing internal-call binding flow.

User Impact

Realtime Twilio audio can attach only to the call that received the corresponding signed TwiML response. Missing or blank call identities are rejected before stream issuance. A mismatched start frame is closed with policy code 1008 and reason Call identity does not match stream session, before call lookup, event processing, or external realtime bridge creation.

Evidence

Carrier simulator run against the built product

This run was captured on b05ba58e, before the branch was rebased onto current main. It has not been repeated on the current head e1c301bc; the current head is covered by the committed boundary regression in the next section.

The built product was run with the bundled Twilio voice-call path and bundled OpenAI realtime provider. A local fake OpenAI Realtime endpoint acknowledged session.update, counted input audio, and emitted one audio delta.

22:42:06.661 signed full webhook -> HTTP 200 + <Connect><Stream>
22:42:06.668 connected + full start, signed CallSid=CA…redacted
22:42:06.726 product log: Realtime bridge starting (providerCallId=CA…redacted)
22:42:06.737 product talk event: session.ready
22:42:07.674 allowed path: realtime connections +1, input frames +50,
             server frames media ×6 + mark ×1
22:42:07.730 mismatch: close 1008 "Call identity does not match stream session",
             realtime connections +0
22:42:07.735 blank CallSid: HTTP 200 rejection TwiML, no Stream
22:42:07.738 invalid signature: HTTP 401 rejection

The invalid-signature status is the product's existing HTTP 401 contract; this change does not alter it.

Start frame that reached bridge setup:

{"event":"start","sequenceNumber":"1","start":{"accountSid":"AC…redacted","streamSid":"MZ…redacted","callSid":"CA…redacted","tracks":["inbound"],"customParameters":{"proof":"carrier-sim-989"},"mediaFormat":{"encoding":"audio/x-mulaw","sampleRate":8000,"channels":1}},"streamSid":"MZ…redacted"}

Contract sources:

This evidence does not include a session originated by Twilio's servers; the carrier side is a simulator that follows Twilio's documented webhook parameters, signature scheme, and Media Streams message formats, and signs requests with Twilio's official SDK.

Committed boundary regression

The boundary test drives the documented Twilio message sequence (connected → full start → media → stop, with the full webhook parameter set) through the real CallManager, TwilioProvider, VoiceCallWebhookServer, RealtimeCallHandler, listening HTTP server, WebSocket upgrade, and production SQLite state store. The trace below is from the focused test executed on the current head e1c301bc (Node v24.22.2); call identities, signing material, and one-time URLs are redacted.

[missing]
[boundary-proof] signed webhook POST CallSid=<missing> -> status=200; rejected before stream issuance; pending sessions=0

[blank]
[boundary-proof] signed webhook POST CallSid=<blank> -> status=200; rejected before stream issuance; pending sessions=0

[matching]
[boundary-proof] signed webhook POST CallSid=CA…redacted -> status=200; one-time stream URL returned=<one-time-token>
[boundary-proof] WebSocket upgrade accepted; one-time stream token=<one-time-token>
[boundary-proof] start frame sent CallSid=CA…redacted -> entry reached; lookup=2 event=2 bridge=1

[mismatched]
[boundary-proof] signed webhook POST CallSid=CA…redacted -> status=200; one-time stream URL returned=<one-time-token>
[boundary-proof] WebSocket upgrade accepted; one-time stream token=<one-time-token>
[boundary-proof] start frame sent CallSid=CA…redacted -> close code=1008 reason="Call identity does not match stream session"; lookup=0 event=0 bridge=0

Test Files  1 passed (1)
Tests       3 passed (3)

The matching path performs two call lookups before bridge entry: the initial resolution, and the live-call recheck after admission persistence. The test now expects both. The mismatch path still requires zero lookups, events, and bridges.

With only the production changes of this pull request reversed (webhook.ts, realtime-handler.ts, realtime-inbound-admission.ts) and every test left in place, the same file fails all three tests; with the changes restored it passes 3/3.

The remaining behavioral test doubles are the external RealtimeVoiceProviderPlugin and its RealtimeVoiceBridge; manager spies are call-through observers.

Rebase onto current main

The branch is rebased onto current main. Main had since split the realtime inbound admission logic out of webhook.ts; the initial-TwiML-request classification now lives beside it as getRealtimeTwimlParams in realtime-inbound-admission.ts, which keeps webhook.ts under its line cap. The binding behavior is unchanged: a signed CallSid is required and trimmed before stream issuance, recorded on the one-time session, and compared against the Twilio start frame before lookup or bridge creation. Telnyx keeps its internal-call binding.

Existing fixtures that started Twilio sessions without a matching provider call identity now supply one. The boundary test is registered with the database-worker test configuration because it uses the SQLite store. config/test-lines-allocations/136506-signed-realtime-boundary.txt requests 49 test lines above the standard allowance for the signed HTTP/WebSocket/SQLite boundary test.

Validation

All on the current head e1c301bc, Node v24.22.2, pnpm 12.15.0:

voice-call webhook + realtime suites (18 files, 204 tests)        PASS
signed-call-boundary.test.ts                                      PASS (3 tests)
production changes reversed, tests kept                           FAIL (3 of 3), as intended
pnpm tsgo:extensions / tsgo:extensions:test                       PASS
lint (changed extension files, test routing module)               PASS
format check (12 changed paths)                                   PASS
pnpm check:baseline-ratchets --base origin/main                   PASS
changed-extensions test shards (30 files, 428 tests)              PASS

Not covered: a session originated by Twilio's servers, and a repeat of the carrier simulator run on the current head.

Twilio carrier simulator used for the run

Install ws and twilio in a scratch npm project, configure the product webhook plus a fake realtime metrics endpoint, and run this script. Synthetic TLS uses a locally trusted test certificate; the lookup hook maps the synthetic proof hostname to loopback.

import assert from "node:assert/strict";
import { randomBytes } from "node:crypto";
import https from "node:https";
import twilio from "twilio";
import WebSocket from "ws";

const webhookUrl = process.env.TWILIO_WEBHOOK_URL;
const authToken = process.env.TWILIO_AUTH_TOKEN;
const metricsUrl = process.env.FAKE_REALTIME_METRICS_URL;
assert(webhookUrl, "TWILIO_WEBHOOK_URL is required");
assert(authToken, "TWILIO_AUTH_TOKEN is required");
assert(metricsUrl, "FAKE_REALTIME_METRICS_URL is required");

const makeSid = (prefix) => prefix + randomBytes(16).toString("hex");
const accountSid = makeSid("AC");
const matchingCallSid = makeSid("CA");
const mismatchedCallSid = makeSid("CA");
const mismatchSignedCallSid = makeSid("CA");
const matchingStreamSid = makeSid("MZ");
const mismatchStreamSid = makeSid("MZ");
const mediaPayload = Buffer.alloc(160, 0xff).toString("base64");

const now = () => new Date().toISOString();
const redactSid = (value) => value.replace(/^(AC|CA|MZ).+$/, "$1…redacted");
const redactUrl = (value) => value.replace(/\/([0-9a-f-]{36})(?=$|[?#])/, "/<one-time-token>");
const log = (event, details = {}) =>
  console.log(JSON.stringify({ timestamp: now(), event, ...details }));
const loopbackLookup = (_hostname, options, callback) => {
  if (options?.all) {
    callback(null, [{ address: "127.0.0.1", family: 4 }]);
    return;
  }
  callback(null, "127.0.0.1", 4);
};

function documentedWebhookParams(callSid) {
  return {
    CallSid: callSid,
    AccountSid: accountSid,
    From: "+14155550100",
    To: "+14155550101",
    CallStatus: "ringing",
    ApiVersion: "2010-04-01",
    Direction: "inbound",
    ForwardedFrom: "+14155550102",
    CallerName: "Carrier Simulator",
    ParentCallSid: makeSid("CA"),
    FromCity: "SAN FRANCISCO",
    FromState: "CA",
    FromZip: "94105",
    FromCountry: "US",
    ToCity: "OAKLAND",
    ToState: "CA",
    ToZip: "94612",
    ToCountry: "US",
  };
}

async function postWebhook(params, signatureOverride) {
  const signature =
    signatureOverride ?? twilio.getExpectedTwilioSignature(authToken, webhookUrl, params);
  if (signatureOverride === undefined) {
    assert.equal(twilio.validateRequest(authToken, signature, webhookUrl, params), true);
  }
  const body = new URLSearchParams(params).toString();
  return new Promise((resolve, reject) => {
    const request = https.request(webhookUrl, {
      method: "POST",
      headers: {
        "content-type": "application/x-www-form-urlencoded",
        "content-length": Buffer.byteLength(body),
        "x-twilio-signature": signature,
      },
      lookup: loopbackLookup,
      rejectUnauthorized: false,
    }, (response) => {
      const chunks = [];
      response.on("data", (chunk) => chunks.push(chunk));
      response.on("end", () => resolve({
        status: response.statusCode,
        text: async () => Buffer.concat(chunks).toString("utf8"),
      }));
    });
    request.once("error", reject);
    request.end(body);
  });
}

function parseStreamUrl(twiml) {
  const encoded = twiml.match(/<Stream\s+url="([^"]+)"/)?.[1];
  return encoded?.replaceAll("&amp;", "&");
}

function openStream(streamUrl) {
  return new Promise((resolve, reject) => {
    const ws = new WebSocket(streamUrl, {
      lookup: loopbackLookup,
      rejectUnauthorized: false,
    });
    ws.once("open", () => resolve(ws));
    ws.once("error", reject);
  });
}

function waitForClose(ws, timeoutMs = 5000) {
  return new Promise((resolve, reject) => {
    const timer = setTimeout(() => reject(new Error("timed out waiting for stream close")), timeoutMs);
    ws.once("close", (code, reason) => {
      clearTimeout(timer);
      resolve({ code, reason: reason.toString() });
    });
  });
}

async function metrics() {
  const response = await fetch(metricsUrl);
  assert.equal(response.status, 200);
  return response.json();
}

function startFrame(callSid, streamSid) {
  return {
    event: "start",
    sequenceNumber: "1",
    start: {
      accountSid,
      streamSid,
      callSid,
      tracks: ["inbound"],
      customParameters: { proof: "carrier-sim-989" },
      mediaFormat: { encoding: "audio/x-mulaw", sampleRate: 8000, channels: 1 },
    },
    streamSid,
  };
}

async function runAllowedPath() {
  const before = await metrics();
  const response = await postWebhook(documentedWebhookParams(matchingCallSid));
  const twiml = await response.text();
  assert.equal(response.status, 200);
  assert.match(twiml, /<Connect>/);
  const streamUrl = parseStreamUrl(twiml);
  assert(streamUrl, "signed webhook did not return a Stream URL");
  log("webhook.accepted", { status: response.status, callSid: redactSid(matchingCallSid) });
  log("stream.url", { url: redactUrl(streamUrl) });

  const ws = await openStream(streamUrl);
  const serverFrames = [];
  ws.on("message", (data) => {
    const frame = JSON.parse(data.toString());
    serverFrames.push(frame);
    log("stream.server-frame", { type: frame.event ?? "unknown" });
  });
  ws.send(JSON.stringify({ event: "connected", protocol: "Call", version: "1.0.0" }));
  const start = startFrame(matchingCallSid, matchingStreamSid);
  ws.send(JSON.stringify(start));
  log("stream.start.sent", {
    frame: { ...start, start: { ...start.start, accountSid: "AC…redacted", streamSid: "MZ…redacted", callSid: "CA…redacted" }, streamSid: "MZ…redacted" },
  });
  for (let index = 0; index < 50; index += 1) {
    ws.send(
      JSON.stringify({
        event: "media",
        sequenceNumber: String(index + 2),
        media: {
          track: "inbound",
          chunk: String(index + 1),
          timestamp: String(index * 20),
          payload: mediaPayload,
        },
        streamSid: matchingStreamSid,
      }),
    );
  }
  await new Promise((resolve) => setTimeout(resolve, 500));
  ws.send(JSON.stringify({ event: "mark", sequenceNumber: "52", mark: { name: "carrier-proof" }, streamSid: matchingStreamSid }));
  ws.send(JSON.stringify({ event: "stop", sequenceNumber: "53", stop: { accountSid, callSid: matchingCallSid }, streamSid: matchingStreamSid }));
  await new Promise((resolve) => setTimeout(resolve, 500));
  if (ws.readyState === WebSocket.OPEN) ws.close(1000, "simulator complete");
  const close = await waitForClose(ws);
  const observed = await metrics();
  const realtimeSessionsAdded = observed.sessions - before.sessions;
  const realtimeAudioFramesAdded = observed.audioFrames - before.audioFrames;
  assert.equal(realtimeSessionsAdded, 1, "matching start did not create exactly one realtime session");
  assert(realtimeAudioFramesAdded >= 50, "media frames did not reach the realtime bridge target");
  assert(serverFrames.some((frame) => frame.event === "media"), "no outbound Twilio media frame received");
  log("allowed.complete", { mediaSent: 50, realtimeSessionsAdded, realtimeAudioFramesAdded, serverFrames: serverFrames.map((frame) => frame.event), close });
}

async function runMismatchPath() {
  const before = await metrics();
  const response = await postWebhook(documentedWebhookParams(mismatchSignedCallSid));
  const streamUrl = parseStreamUrl(await response.text());
  assert.equal(response.status, 200);
  assert(streamUrl);
  const ws = await openStream(streamUrl);
  ws.send(JSON.stringify({ event: "connected", protocol: "Call", version: "1.0.0" }));
  ws.send(JSON.stringify(startFrame(mismatchedCallSid, mismatchStreamSid)));
  const close = await waitForClose(ws);
  const after = await metrics();
  assert.deepEqual(close, { code: 1008, reason: "Call identity does not match stream session" });
  assert.equal(after.sessions, before.sessions, "mismatched start created a realtime session");
  log("mismatch.rejected", { callSid: redactSid(mismatchedCallSid), close, realtimeSessionsAdded: 0 });
}

async function runWebhookNegativePaths() {
  const blankParams = documentedWebhookParams("   ");
  const blankResponse = await postWebhook(blankParams);
  const blankBody = await blankResponse.text();
  assert.equal(blankResponse.status, 200);
  assert.match(blankBody, /<Reject reason="rejected" \/>/);
  assert.doesNotMatch(blankBody, /<Stream/);
  log("blank-call-sid.rejected", { status: blankResponse.status, streamIssued: false });

  const invalidResponse = await postWebhook(documentedWebhookParams(matchingCallSid), "invalid-signature");
  assert.equal(invalidResponse.status, 401);
  log("invalid-signature.rejected", { status: invalidResponse.status });
}

await runAllowedPath();
await runMismatchPath();
await runWebhookNegativePaths();
log("simulator.complete", { result: "PASS" });

@clawsweeper

clawsweeper Bot commented Sep 2, 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.

@clawsweeper clawsweeper Bot added P1 High-priority user-facing bug, regression, or broken workflow. merge-risk: 🚨 security-boundary 🚨 May affect sandboxing, authorization, credentials, or sensitive data. rating: 🦪 silver shellfish Thin PR readiness signal; proof, validation, or implementation needs work. status: 📣 needs proof The PR needs real behavior proof before ClawSweeper can clear the contributor ask. labels Sep 2, 2026
@clawsweeper

clawsweeper Bot commented Sep 2, 2026 •

Copy link
Copy Markdown
Contributor

Codex review: needs maintainer review before merge.

What this changes

This PR binds Twilio realtime stream sessions to the call identity in the verified webhook and rejects missing or mismatched identities.

Example: A stream URL issued for signed CallSid CA22222222222222222222222222222222 receives a start frame naming CA33333333333333333333333333333333.

  • Before: The start-frame identity could enter call registration and realtime bridge setup.
  • After: The socket closes with code 1008 before call lookup, event processing, or bridge creation.

Review scores

Measure Result What it means
Overall readiness 🐚 platinum hermit (4/6) A focused, correct boundary repair with applicable product-run evidence and a corrected current-head regression.
Proof confidence 🐚 platinum hermit (4/6) Sufficient (logs): The supplied built-product simulator exercised signed HTTP issuance, real WebSocket transport, matching audio exchange, and mismatch rejection on b05ba58; source inspection confirms the binding checks remain equivalent, and current-head boundary output covers the rebased asynchronous admission path. The simulator used a fake realtime endpoint and did not originate calls from Twilio servers.
Patch quality 🦞 diamond lobster (5/6) No actionable review findings were identified.

Product

Kind: Bug fix · Worth it: Yes · Fix scope: Complete
User problem: Realtime audio can be associated with a call other than the one identified by the verified Twilio webhook.
Reason: The maintainer-authored direction repairs an existing identity boundary without adding configuration, a public API, or another state owner.

Merge readiness

✅ Ready for maintainer review

This PR fixes a current call-identity boundary defect. The prior lookup-assertion finding is resolved, no new actionable defects were found, and current-head CI is still pending.

Priority: P1
Reviewed head: e1c301bcdb50789b1fdd6b0d87bb54e2bc957658

Before merge

None.

Findings

None.

Agent review details

How this fits together

The voice-call plugin converts verified carrier webhooks into one-time WebSocket sessions, then admits carrier audio into the call manager and realtime voice bridge.

flowchart LR
  A[Carrier webhook] --> B[Signature verification]
  B --> C[Call identity and inbound policy]
  C --> D[One-time stream session]
  D --> E[WebSocket start identity check]
  E --> F[Call manager]
  F --> G[Realtime voice bridge]
Loading

Technical review

Best possible solution:

Retain the focused signed-call binding and boundary regression, then land through the normal current-head CI gates.

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

Current-main source exposes the unbound Twilio path, and the contributor reports that reverting only the production fix makes all three retained boundary cases fail; this review did not execute tests.

Is this the best way to solve the issue?

The smallest complete repair uses the existing webhook verifier, one-time session metadata, and stream admission owner; the classification helper preserves existing predicates, and fixture updates serve the strengthened identity contract.

AGENTS.md: found and applied where relevant.

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

Provenance checked

  • Twilio stream issuance changes intended behavior with a stated reason (feat(voice call): add Telnyx Media Streaming for voice-call realtime #81024: The carrier-generalization work retained Twilio's TwiML-based issuance while adding Telnyx dial/answer issuance; this PR explicitly explains why Twilio now also needs signed call binding.)
  • Telnyx internal-call binding keeps the original intent (665c29d: Resolve an issued internal call and require its carrier identity to match before admitting the stream.)
  • Awaited call admission keeps the original intent (refactor(voice-call): await call persistence and lifecycle work #145047: Wait for persistence and pending identity updates before publishing or admitting calls; retain live-call validation after awaited work.)
  • Initial TwiML request classification keeps the original intent (93a9fa4: Localize webhook selection while preserving routing, authority, fallback, and settlement; the extracted predicate keeps those exclusions intact.)

Testing

Proof path: shipped entry point.

Security

None.

Evidence

What I checked:

Likely related people:

  • Mariano: Raw commit 9fa2a21 adds extensions/voice-call/src/webhook/realtime-inbound-admission.ts:5 relative to its recorded parents. This identifies author metadata, not feature responsibility or a PR merger. (role: source-line author; confidence: medium; commits: 9fa2a214dde1; files: extensions/voice-call/src/webhook/realtime-inbound-admission.ts)

PR surface

Source +12, Tests +450, Other +4. Total +466 across 12 files. Added test files: 1.

View PR surface stats
Area Files Added Removed Net
Source 3 53 41 +12
Tests 8 481 31 +450
Docs 0 0 0 0
Config 0 0 0 0
Generated 0 0 0 0
Other 1 4 0 +4
Total 12 538 72 +466

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 test changes Production +53/-41; tests and test helpers +480/-31 Production growth is limited to binding and admission; most test growth provides the previously missing signed HTTP-to-WebSocket boundary regression.

Labels

Label changes:

  • add rating: 🐚 platinum hermit: Overall readiness is 🐚 platinum hermit; proof is 🐚 platinum hermit and patch quality is 🦞 diamond lobster.
  • add status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR.
  • 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: The existing realtime path can associate a stream with a different call identity than the signed webhook that issued its URL.
  • rating: 🐚 platinum hermit: Overall readiness is 🐚 platinum hermit; proof is 🐚 platinum hermit and patch quality is 🦞 diamond lobster.
  • status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR.
  • proof: sufficient: Contributor real behavior proof is sufficient.

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 (10 earlier review cycles; latest 8 shown)
  • reviewed 2026-09-02T20:06:18.773Z sha 0222d0740b881d56c68d325d843076c3c2a3f88a :: needs real behavior proof before merge. :: [P1] Reject realtime setup without a signed CallSid
  • reviewed 2026-09-02T20:50:14.479Z sha b05ba58 :: needs real behavior proof before merge. :: none
  • reviewed 2026-09-02T23:02:05.027Z sha fcecc64 :: needs real behavior proof before merge. :: none
  • reviewed 2026-09-17T16:28:21.977Z sha aa23aa5 :: blocked before merge. :: [P2] [P2] Account for the live-call recheck in the boundary assertion
  • reviewed 2026-09-17T16:38:23.867Z sha ef13d6b :: needs changes before merge. :: [P2] [P2] Account for the live-call recheck in the boundary assertion
  • reviewed 2026-09-17T20:17:30.469Z sha 31eb248 :: needs changes before merge. :: [P2] [P2] Account for both matching-path call lookups
  • reviewed 2026-09-23T01:46:38.098Z sha 31eb248 :: needs changes before merge. :: [P2] [P2] Account for both matching-path call lookups
  • reviewed 2026-10-07T19:40:51.543Z sha 31eb248 :: needs changes before merge. :: [P2] Account for both matching-path call lookups

Reviewed November 19, 2026, 1:07 PM ET / 18:07 UTC (Revision 11).

@openclaw-barnacle openclaw-barnacle Bot added channel: voice-call Channel integration: voice-call size: S maintainer Maintainer-authored PR labels Sep 2, 2026
@drobison00

Copy link
Copy Markdown
Contributor Author

Devin Robison · GPT-5 Codex · via @drobison00

Implemented the requested rank-up move in b14332194a24ce60cd72f27df1800f3f2ae080e9.

The new regression crosses the real server boundary: it sends an actually signed Twilio webhook
through VoiceCallWebhookServer, extracts the returned one-time stream URL, connects through the
server's HTTP upgrade path, and sends a start frame with a different CallSid. The socket closes
with 1008 / Call identity does not match stream session before call lookup, event processing,
or realtime provider resolution.

I also reverse-applied only the production hunk while retaining this test. It failed on the old
Caller rejected by policy path, then passed again after restoration. The full webhook and
realtime-handler suites, extension test typecheck, path-scoped lint/format, and structured
autoreview all pass.

@clawsweeper clawsweeper Bot added rating: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. and removed rating: 🦪 silver shellfish Thin PR readiness signal; proof, validation, or implementation needs work. labels Sep 2, 2026
@drobison00

Copy link
Copy Markdown
Contributor Author

Devin Robison · GPT-5 Codex · via @drobison00

Round-2 executed evidence is now included in the PR body. The new boundary test drives both identities through the real signed webhook, listening server, WebSocket upgrade, call manager, lookup, and bridge boundary: the matching CallSid reaches lookup/event/bridge with counts 1/2/1, while the mismatch closes with 1008 / Call identity does not match stream session with counts 0/0/0.

The only behavioral doubles are the external RealtimeVoiceProviderPlugin and RealtimeVoiceBridge; manager spies are call-through observers. Against current main, the hosted core stripe and changed-file check reported only unrelated existing failures in src/cli/gateway-backed-exit.process.test.ts:1119:4 (max-lines) and extensions/browser/src/browser/chrome-mcp-options.ts:3:23 (missing yargs-parser declarations). The verified new SHA is 0222d0740b881d56c68d325d843076c3c2a3f88a.

This evidence does not include a live Twilio Media Streams session; provider wire behavior is covered by the adapter tests rather than a live call.

@drobison00

Copy link
Copy Markdown
Contributor Author

Devin Robison · GPT-5 Codex · via @drobison00

The blank-CallSid gap was real. A signed Twilio webhook with a missing or whitespace-only CallSid is now rejected with the existing non-disclosing TwiML before <Stream> issuance or one-time session creation, with regressions for both cases. The matching identity still reaches lookup/bridge setup, while a mismatch closes with 1008 before either boundary.

The branch is rebased onto current main. Core lint stripes 2–5 pass; stripe 1's only finding is the pre-existing max-lines count in src/cli/gateway-backed-exit.process.test.ts, which this branch does not touch and which main already split under the cap in aef65cc. The complete changed-file check passes.

This evidence does not include a live Twilio Media Streams session; provider wire behavior is covered by the adapter tests rather than a live call.

Verified new SHA: b05ba58e701fc3ead489eecfab74245f5c18e912.

@drobison00

Copy link
Copy Markdown
Contributor Author

Devin Robison · GPT-5 Codex · via @drobison00

Pushed fcecc64555de77e86732f0c4bbd11196e5aba275 with the carrier-shaped boundary test and added a black-box run against the built product. The official Twilio SDK signed the full webhook; the matching documented start forwarded 50 μ-law frames to the realtime bridge and returned outbound media, while mismatch closed 1008 before bridge creation and blank identity/invalid signature were rejected. Focused suites, changed-file checks, formatting, build, and the pre-fix failure proof all passed as expected.

This evidence does not include a session originated by Twilio's servers; the carrier side is a simulator that follows Twilio's documented webhook parameters, signature scheme, and Media Streams message formats, and signs requests with Twilio's official SDK.

Wire contracts: https://www.twilio.com/docs/voice/twiml#twilios-request-to-your-application · https://www.twilio.com/docs/usage/webhooks/webhooks-security · https://www.twilio.com/docs/voice/media-streams/websocket-messages · https://www.twilio.com/docs/voice/twiml/stream

@clawsweeper clawsweeper Bot added proof: sufficient ClawSweeper judged the real behavior proof convincing. status: ⏳ waiting on author ClawSweeper has contributor-facing work open and is waiting for author action. and removed 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 Sep 17, 2026
@drobison00

Copy link
Copy Markdown
Contributor Author

@clawsweeper re-review

GPT - 6.1 Sol - tender (engineer) via @drobison00 - Rebased onto current main and corrected the matching-path lookup assertion; the description now carries the boundary trace and validation for this head.

@clawsweeper

clawsweeper Bot commented Nov 19, 2026 •

Copy link
Copy Markdown
Contributor

🦞👀
Exact review queued.

Re-review progress:

@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 Nov 19, 2026
@drobison00
drobison00 merged commit 3b8b74f into openclaw:main Nov 19, 2026
136 checks passed
pipthefox added a commit to pipthefox/openclaw that referenced this pull request Nov 20, 2026
github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Nov 20, 2026
* fix(voice-call): bind realtime streams to signed calls

* test(voice-call): cover signed stream binding boundary

* test(voice-call): drive documented Twilio stream frames through the signed boundary

* test(voice-call): account for admission persistence recheck
pipthefox added a commit to pipthefox/openclaw that referenced this pull request Nov 20, 2026
pipthefox added a commit to pipthefox/openclaw that referenced this pull request Nov 20, 2026
pipthefox added a commit to pipthefox/openclaw that referenced this pull request Nov 20, 2026
pipthefox added a commit to pipthefox/openclaw that referenced this pull request Nov 20, 2026
pipthefox added a commit to pipthefox/openclaw that referenced this pull request Nov 21, 2026
pipthefox added a commit to pipthefox/openclaw that referenced this pull request Nov 21, 2026
pipthefox added a commit to pipthefox/openclaw that referenced this pull request Nov 21, 2026
pipthefox added a commit to pipthefox/openclaw that referenced this pull request Nov 21, 2026
pipthefox added a commit to pipthefox/openclaw that referenced this pull request Nov 22, 2026
tideclaw-bot pushed a commit that referenced this pull request Nov 23, 2026
* fix(voice-call): bind realtime streams to signed calls

* test(voice-call): cover signed stream binding boundary

* test(voice-call): drive documented Twilio stream frames through the signed boundary

* test(voice-call): account for admission persistence recheck

(cherry picked from commit 3b8b74f)

Co-authored-by: RomneyDa <[email protected]>
(cherry picked from commit 53b683162748a2e369707ed56704b8d4218b11b3)
(cherry picked from commit 39f662b12c15883376b1e85281a9add08a2ceb8f)
tideclaw-bot pushed a commit that referenced this pull request Nov 24, 2026
Baseline adaptation: Keep the existing stable TwiML selector, replay and inbound admission gates, and Telnyx pre-dial manager identity semantics. Bind Twilio issuance and admission to the accepted signed CallSid and adapt the stable realtime fixtures, including native playback, to supply matching call identities.

(cherry picked from commit 3b8b74f)

Co-authored-by: RomneyDa <[email protected]>
(cherry picked from commit 5a149e635c85342115102f147f75a992e87dba1b)
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 maintainer Maintainer-authored PR P1 High-priority user-facing bug, regression, or broken workflow. proof: sufficient ClawSweeper judged the real behavior proof convincing. 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