Repository navigation
Commit e6ad2ff
fix(voice-input): keep Meta realtime dictation on HTTP/1.1 WebSockets (#1710)
## Problem
Desktop dictation fails with "Could not prepare voice transcription." on the release `t3` runtime.
That runtime is a Node 26 SEA: undici 8 defaults `allowH2` on, so the global `WebSocket` negotiates RFC 8441 WebSocket over HTTP/2 with `api.meta.ai`.
undici 8.10.2 then fails Meta's valid h2 response because `Sec-WebSocket-Accept` is missing (close 1006); the undici fix, `nodejs/undici#5774`, closed unmerged.
Dev and packaged-desktop backends run Electron's Node 24 (undici 7, HTTP/1.1), so they never reproduced it.
## Change
The realtime route provides `NodeSocket.layerWebSocketConstructorWS` in place of the global constructor.
The `ws` package is already bundled and stays on HTTP/1.1.
```diff
- ).pipe(Effect.provide(NodeSocket.layerWebSocketConstructor), Effect.ignoreCause);
+ // `ws` stays on HTTP/1.1. Node 26's undici negotiates WebSocket over HTTP/2 with Meta, then
+ // fails the valid RFC 8441 response for lacking Sec-WebSocket-Accept.
+ ).pipe(Effect.provide(NodeSocket.layerWebSocketConstructorWS), Effect.ignoreCause);
```
## Scope and approval
Maintainer reported the regression, tested the fix live in T3 Code, and authorized this PR and merge.
One-line transport swap inside the fork voice-input route.
## Verification
- [x] Maintainer dictated successfully against a Node 26 dev server with this fix.
- [x] Node 26 dev server: `/api/fork/voice-input/realtime` upgraded 101, and Meta acknowledged the session.
- [x] Direct Meta probe: 2s of PCM plus `endStream` returned a final transcript and closed 1000.
- [x] `vp test run apps/server/src/voice-input`: 45/45 passed.
- [x] `vp run typecheck` (apps/server): exit 0.
- [x] `vp run fork:ci`: exit 0.
Follow-up, not in this PR: the client maps every realtime failure, including Meta's own error message, to the generic "Could not prepare" text.
Claude Opus 5.5 via Claude Code in T3 Code.
## Fork trailers
Fork-Domain: voice-input
Fork-Tier: bugfix
Fork-Upstreamable: no
Co-authored-by: donjor <[email protected]>1 parent f43fd48 commit e6ad2ff
1 file changed
Lines changed: 3 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
138 | 138 | | |
139 | 139 | | |
140 | 140 | | |
141 | | - | |
| 141 | + | |
| 142 | + | |
| 143 | + | |
142 | 144 | | |
143 | 145 | | |
144 | 146 | | |
| |||
0 commit comments