Repository navigation
feat(conv): choose which voice channel answers a chat widget's calls - #1151
Merged
Merged
Conversation
conv_create_widget_channel and conv_update_widget_channel take a voiceChannelId, as do POST and PATCH /v1/conversations/channels/widget. The id must be a Vapi or Threll voice channel in the same organization that has not been deleted; anything else is refused with conv_widget_voice_channel_invalid before it is saved. Until now the link could only be set in the database. Updating a widget channel no longer erases its voice link: the update rebuilt the config from a fixed field list, so any edit dropped voiceChannelId and calls fell back to multiple_voice_channels_without_widget_routing. The dashboard gains an Edit dialog for widget channels (origin allow-list and voice channel), a voice channel picker on create, and a note on each widget card saying where its calls go or why they are off. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Why
When an organization has more than one voice channel, the chat widget's call button only works if the widget channel names one in
voiceChannelId. Otherwise the server returnsmultiple_voice_channels_without_widget_routinginstead of guessing. But nothing could set that field: no MCP tool, no/v1route and no dashboard control. On top of that,conv_update_widget_channelrebuilt the stored config from a fixed list of fields, so any update, even one that only changed the origin allow-list, silently erased a link someone had set by hand.What changes
Backend. Both MCP tools and the
/v1routes callWidgetChannelAdminService, so the change lands in one place.conv_create_widget_channel/POST /v1/conversations/channels/widgettake an optionalvoiceChannelId.conv_update_widget_channel/PATCH /v1/conversations/channels/widget/:idtake a nullablevoiceChannelId: omit it to keep the link, passnullto unlink.conv_widget_voice_channel_invalidwith acode, so the dashboard shows it translated.vapi,threll) is one constant shared by the call-time lookup and the new check.Dashboard (
channels.tsx)en.jsonandnb.json.Docs.
setup-chat-widget.mdgets a "Link a voice channel" section: how the server picks a channel, the reason codes, and the tool call. Fixtures andopenapi.jsonare regenerated.Tests
New cases in
widget.integration.test.ts:null;PATCH /v1, which returns a 400 with the code;Results:
widget.integration.test.ts+widget-voice.integration.test.ts: 94 passed.dashboard-pages: 395 passed.🤖 Generated with Claude Code