Skip to content

feat(widget): render the concurrency wait-queue status - #967

Merged
raghavan-gv merged 8 commits into
mainfrom
raghavan/widget-queue-status
Aug 21, 2026
Merged

feat(widget): render the concurrency wait-queue status#967
raghavan-gv merged 8 commits into
mainfrom
raghavan/widget-queue-status

Conversation

@raghavan-gv

@raghavan-gv raghavan-gv commented Aug 20, 2026

Copy link
Copy Markdown
Contributor

What

Widget follow-up to elevenlabs/xi#46137: the embeddable ConvAI widget now renders the concurrency wait-queue lifecycle from the queue_status server events (waiting / admitted / timed_out).

  • No @elevenlabs/client changes: the SDK forwards unhandled server events to onDebug on both the WebSocket and WebRTC transports. Once the queue is finalized then we will make the SDK changes.

Testing

Tested by embedding widget in a local server connecting it to local backend

Screen.Recording.2026-08-20.at.4.42.03.PM.mov

@cursor

cursor Bot commented Aug 20, 2026

Copy link
Copy Markdown
Contributor

PR Summary

Medium Risk
Touches conversation session handling and send gating based on loosely typed debug events; a mis-parsed status could block messaging or hide real disconnect errors.

Overview
The ConvAI widget now follows queue_status server events (waiting / admitted / timed_out) so users see a waiting state when all agents are busy, instead of looking connected or erroring out.

While queued, the UI shows waiting copy (short in the header/trigger, full on the avatar overlay), hides the typing indicator, and blocks text, attachments, rich-content buttons, and event-bridge sends. Unknown statuses do not lock the UI. On timeout, disconnect is treated as a friendly queue_timeout transcript message rather than a raw error. Admission restores the normal conversation flow.

Events are parsed via onDebug until the client SDK exposes queue_status natively. Layout tweaks keep the longer waiting label inside the full trigger.

Reviewed by Cursor Bugbot for commit 377906c. Bugbot is set up for automated code reviews on this repo. Configure here.

@raghavan-gv
raghavan-gv marked this pull request as ready for review August 20, 2026 12:34

@kamilk-11 kamilk-11 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

Comment thread packages/convai-widget-core/src/contexts/conversation.tsx Outdated
Comment thread packages/convai-widget-core/src/widget/AvatarOverlay.tsx Outdated
Comment thread packages/convai-widget-core/src/widget/StatusLabel.tsx Outdated
Comment thread packages/convai-widget-core/src/widget/StatusLabel.tsx Outdated
@raghavan-gv
raghavan-gv requested a review from kamilk-11 August 21, 2026 11:18
Handle the queue_status server events (waiting/admitted/timed_out) in the
embeddable widget, mirroring elevenlabs/xi#46137 for the agent Preview:
show a waiting status while all agents are busy, hide the typing indicator
and block text/attachment sending while queued, and render a friendly
non-error message when the queue wait times out. New queue_waiting_status
and queue_timed_out text-content keys are customizable like all other copy.
Live-testing the embed against a real backend showed the full waiting
sentence collapsing to min-content width in the avatar overlay pill and
overflowing into the composer, and it cannot fit the single-line pills in
the sheet header and full trigger at all. The avatar overlay wrapper now
sizes to w-max so the copy wraps at its intended cap, and the cramped
surfaces show a new short queue_waiting_status_short key ("Waiting for an
available agent") instead.
The status label was absolutely positioned over the main label, so it
never contributed to the trigger's width and the long queue-waiting
copy got clipped at the card edge. Stack both labels in one grid cell
so the wider one sizes the card, and truncate single-line statuses
that exceed the cap instead of spilling past it.
Derive wrapping from the compact prop instead of hardcoding it per
label type so long custom copy wraps on spacious surfaces too, take
the suggested useState simplification, trim the verbose comments, and
mark the onDebug narrowing as interim until the SDK handles
queue_status explicitly.
@raghavan-gv
raghavan-gv force-pushed the raghavan/widget-queue-status branch from 040e8ea to 15cb2ed Compare August 21, 2026 11:27

@cursor cursor Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Cursor Bugbot has reviewed your changes using default effort and found 1 potential issue.

Fix All in Cursor

❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, have a team admin enable autofix in the Cursor dashboard.

Reviewed by Cursor Bugbot for commit 15cb2ed. Configure here.

Comment thread packages/convai-widget-core/src/contexts/conversation.tsx
The queue gate lived only in SheetActions' canSend, so rich-content
message buttons and elevenlabs-agent:user-message events could still
send (and append transcript entries) while the orchestrator was
discarding client messages. Guard sendUserMessage and
sendMultimodalMessage at the source and render rich-content buttons
disabled while waiting.
@raghavan-gv
raghavan-gv merged commit d4313cc into main Aug 21, 2026
5 checks passed
@raghavan-gv
raghavan-gv deleted the raghavan/widget-queue-status branch August 21, 2026 15:03
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.

2 participants