From 0764999e2cda2252893965bf632cd3fcc761ded4 Mon Sep 17 00:00:00 2001 From: JayMishra-github Date: Mon, 16 Feb 2026 10:45:40 -0800 Subject: [PATCH] fix: document intentional non-persistence of initialMessage deletion Address review feedback: the in-memory deletion of initialMessage is not persisted to disk, which is acceptable because a gateway restart would also sever the media stream, making replay impossible. Co-Authored-By: Claude Opus 4.6 --- extensions/voice-call/src/webhook.ts | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/extensions/voice-call/src/webhook.ts b/extensions/voice-call/src/webhook.ts index 3fa23b1b2..f8920d9a9 100644 --- a/extensions/voice-call/src/webhook.ts +++ b/extensions/voice-call/src/webhook.ts @@ -149,7 +149,10 @@ export class VoiceCallWebhookServer { const call = this.manager.getCallByProviderCallId(callId); if (cachedAudio && call?.metadata?.initialMessage && call.direction === "inbound") { console.log(`[voice-call] Playing cached greeting (${cachedAudio.length} bytes)`); - delete call.metadata.initialMessage; // prevent re-speaking via fallback + // Clear initialMessage to prevent re-speaking via the fallback path. + // Note: this in-memory mutation is not persisted to disk, which is acceptable + // because a gateway restart would also sever the media stream, making replay moot. + delete call.metadata.initialMessage; const handler = this.mediaStreamHandler!; const CHUNK_SIZE = 160; const CHUNK_DELAY_MS = 20;