Skip to content

Commit 4110eb9

Browse files
amethystaniclaude
andcommitted
fix: update ElevenLabs SDK and fix voice AI WebSocket disconnect
- Upgrade @elevenlabs/react 0.14.1 → 0.14.3 - Upgrade @elevenlabs/client 0.15.0 → 0.15.2 Root cause: ElevenLabs server now sends 'multimodal_message' WebSocket events during session init. The old client (0.15.0) didn't handle this event type — the server would close the connection, then the SDK cleanup called socket.close() on an already-CLOSED socket, producing the repeated "WebSocket is already in CLOSING or CLOSED state" errors. 0.15.2 adds multimodal_message handling, restoring the connection flow. Also fixed: overrides.agent.first_message (snake_case) → firstMessage (camelCase) — SDK reads i.firstMessage so the greeting was silently dropped on every call start. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
1 parent 724dfe5 commit 4110eb9

File tree

3 files changed

+17
-14
lines changed

3 files changed

+17
-14
lines changed

package-lock.json

Lines changed: 13 additions & 12 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,8 @@
1313
"dependencies": {
1414
"@11labs/client": "^0.0.4",
1515
"@base-ui/react": "^1.2.0",
16-
"@elevenlabs/react": "^0.14.1",
16+
"@elevenlabs/client": "^0.15.2",
17+
"@elevenlabs/react": "^0.14.3",
1718
"@radix-ui/react-accordion": "^1.2.12",
1819
"@radix-ui/react-dialog": "^1.1.15",
1920
"@radix-ui/react-separator": "^1.1.8",

src/components/DemoCall/UserPhoneInterface.tsx

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -144,7 +144,8 @@ export default function UserPhoneInterface({
144144
prompt: systemPrompt,
145145
},
146146
// Use the KB greeting as the agent's opening line
147-
first_message: knowledgeBase.greeting || undefined,
147+
// SDK reads firstMessage (camelCase), not first_message
148+
firstMessage: knowledgeBase.greeting || undefined,
148149
},
149150
},
150151
});

0 commit comments

Comments
 (0)