Skip to content

fix(conv): give voice calls the per-channel descriptor - #1318

Merged
kmonsoe merged 1 commit into
mainfrom
fix/voice-channel-descriptor
Nov 27, 2026
Merged

kmonsoe merged 1 commit into
mainfrom
fix/voice-channel-descriptor

Conversation

@kmonsoe

@kmonsoe kmonsoe commented Nov 27, 2026

Copy link
Copy Markdown
Contributor

Problem

skill://conv/serve-multiple-sites says email, SMS and voice channels can all carry per-site bindings, and that the agent reads a per-channel descriptor (agent-runtime/channel-<channel id>). Only the text agent read that descriptor (conversation-handler.ts). The voice prompt built in composeVoiceSystemPrompt included neither it nor the channel name. An org running several sites could pin each voice channel's KB spaces and store connections, but the voice agent was never told which site the call was for.

Change

  • loadVoiceChannelContext reads the descriptor and builds the same [Channel] block the text agent uses. If the read fails, the block still names the channel and the call goes ahead.
  • composeVoiceSystemPrompt now takes any number of context blocks. Order: voice system prompt, company context, [Channel], then caller or language context.
  • Threll and Vapi phone calls use the voice channel's descriptor.
  • Widget calls use the widget channel's descriptor, not the voice channel's. One shared voice channel can then take calls from every site's widget and still answer for the right site. This matches the conversation's own channel, which is what the KB and connection bindings for widget voice tool calls already follow.
  • serve-multiple-sites.md now describes voice behaviour.

Tests

  • Unit (vapi-assistant.test.ts): block formatting, the slug lookup, a failed read, and the order of the composed prompt.
  • Integration: a Threll worker_request includes the voice channel's descriptor. A widget voice start includes the widget channel's descriptor and not the voice channel's.
  • Threll, Vapi and widget-voice suites pass locally (85 tests).

Related

Independent of #1317. After both merge, the "What the voice agent is told" section that #1317 adds to setup-voice-sms-channel.md should mention the [Channel] block. Whichever PR lands second can add that line.

🤖 Generated with Claude Code

Phone calls on Threll and Vapi, and widget calls, now get the same
[Channel] block text conversations get: the channel's name and id plus
its agent-runtime/channel-<id> descriptor. A widget call uses the widget
channel's descriptor rather than the voice channel's, so a shared voice
channel still answers for the site the call came from.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@kmonsoe
kmonsoe merged commit 3cab42c into main Nov 27, 2026
7 checks passed
@kmonsoe
kmonsoe deleted the fix/voice-channel-descriptor branch November 27, 2026 14:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant