From 690c857c7138412728e299b5342f45956e3e3c54 Mon Sep 17 00:00:00 2001 From: Shashwat Date: Thu, 13 Aug 2026 20:06:27 +0800 Subject: [PATCH] fix(voice): preserve microphone binary frames --- apps/desk/test/production-config.node.test.ts | 1 + apps/desk/wrangler.jsonc | 10 +++++++++- docs/development.md | 9 ++++++++- 3 files changed, 18 insertions(+), 2 deletions(-) diff --git a/apps/desk/test/production-config.node.test.ts b/apps/desk/test/production-config.node.test.ts index 4280df9..efec247 100644 --- a/apps/desk/test/production-config.node.test.ts +++ b/apps/desk/test/production-config.node.test.ts @@ -73,6 +73,7 @@ describe('production Wrangler configuration', () => { expect(configured.r2_buckets[0]).toMatchObject({ bucket_name: variables.ABLE_R2_BUCKET_NAME }) expect(configured.queues.producers[0].queue).toBe(variables.ABLE_MEDIA_QUEUE_NAME) expect(configured.queues.consumers[0].queue).toBe(variables.ABLE_MEDIA_QUEUE_NAME) + expect(configured.compatibility_flags).toContain('no_websocket_standard_binary_type') }) it('rejects source text that is not valid JSONC', () => { diff --git a/apps/desk/wrangler.jsonc b/apps/desk/wrangler.jsonc index b930b5f..8599dc9 100644 --- a/apps/desk/wrangler.jsonc +++ b/apps/desk/wrangler.jsonc @@ -5,7 +5,15 @@ "workers_dev": false, "preview_urls": false, "compatibility_date": "2026-08-13", - "compatibility_flags": ["nodejs_compat"], + "compatibility_flags": [ + "nodejs_compat", + // @cloudflare/voice 0.3.5 only forwards inbound microphone frames when + // Agents SDK delivers them as ArrayBuffer. Compatibility dates on or after + // 2026-03-17 otherwise deliver binary WebSocket messages as Blob, which + // makes the voice mixin silently discard every audio frame. Remove this + // bridge once the published voice package handles Blob input. + "no_websocket_standard_binary_type" + ], "assets": { "binding": "ASSETS", "directory": "./public", diff --git a/docs/development.md b/docs/development.md index d24de19..ced9174 100644 --- a/docs/development.md +++ b/docs/development.md @@ -38,8 +38,15 @@ The command intentionally uses a hybrid Cloudflare development topology: account's inference quota. Wrangler's local remote-binding proxy does not preserve the raw response and WebSocket shapes required by Cloudflare Voice, so `dev:parity` deliberately disables the microphone instead of presenting a - silent call. Test Nova-3 STT and Aura-2 TTS on a deployed staging or production + silent call. Test Flux STT and Aura-2 TTS on a deployed staging or production Worker, where the code and AI binding both execute on Cloudflare. +- Cloudflare Voice 0.3.5 still expects inbound microphone frames as + `ArrayBuffer`, while current Worker compatibility dates otherwise deliver + binary WebSocket messages as `Blob`. The committed Wrangler configuration + therefore carries Cloudflare's `no_websocket_standard_binary_type` + compatibility bridge. Keep it in every generated deployment configuration + until the published voice package accepts `Blob`; removing it silently drops + microphone audio before transcription. - D1, R2, queues, Durable Objects, Email Service, rate limits, and fixtures are local simulations. Email acceptance and edge security controls therefore need separate staging smoke tests.