Conversation
…ages When set, the widget starts a text conversation as soon as the chat panel opens instead of waiting for the user's first message. This lets the agent generate the greeting server-side, e.g. from a workflow that resolves customer context through tools before speaking. Co-Authored-By: Claude Fable 5 <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.
Motivation
PostNord (Slack thread) wants the agent to greet widget users with a personalized, server-generated first message: the client passes only a
customer_hash_iddynamic variable, a workflow tool resolves it to customer context, and the agent greets with that context.The backend already supports this: a workflow whose start path leads to a tool node forces the first agent turn on connect (
RuntimeStartAgent), andentry_behavior: generate_immediatelydoes the same for agent-node entries. Mobile/JS SDK users get this today because they control when the session starts.The embed widget is the one place it cannot work: in text mode the widget renders the configured first message locally and only opens the connection when the user sends their first message, so the agent never gets a chance to speak first.
What this does
Adds an opt-in
auto-start-textattribute:When set, the widget starts a text-only session as soon as the chat panel opens (immediately with
default-expanded), and the opening message arrives over the wire from the agent. Scoped to text sessions on purpose: auto-starting voice would trigger a mic permission prompt on open.Behavior notes:
startSessionpath, so theelevenlabs-convai:callevent still fires and can be used to inject fresh config.Testing
convai-widget-coresuite passes exceptDismissButton.test.ts("expandable widget should hide all elements when dismissed"), which fails identically on cleanmain.Screenshot from the browser test (MSW-mocked backend): the panel just opened, no user input, and the server-sent greeting is rendered. Real-agent capture pending an agent configured with a start-to-tool workflow.
Follow-ups
🤖 Generated with Claude Code