Skip to content

feat(voice): stream tool call status events#6100

Open
longcw wants to merge 8 commits into
mainfrom
longc/async-task-ui
Open

feat(voice): stream tool call status events#6100
longcw wants to merge 8 commits into
mainfrom
longc/async-task-ui

Conversation

@longcw

@longcw longcw commented Jun 14, 2026

Copy link
Copy Markdown
Contributor

Adds a tool_status_updated session event that streams the lifecycle of each function tool call, so frontends and remote sessions can render tool progress (especially for async/long-running tools that use ctx.update()).

The event (ToolStatusUpdatedEvent) carries one of three updates:

  • ToolCallStarted — a tool call was dispatched.
  • ToolCallUpdated — a progress update (running) from ctx.update(), or the call's single terminal entry (done/error/cancelled).
  • ToolReplyUpdated — the deferred reply that voices buffered updates (scheduled then completed/interrupted/skipped).

SessionHost forwards the event to remote sessions over the new AgentSessionEvent.ToolStatusUpdated proto (livekit/protocol#1625), and the new types are exported from livekit.agents. The async_tool_agent example shows publishing the stream to a frontend.

Depends on livekit/protocol#1625 and livekit/python-sdks#716 for the generated bindings.

@longcw longcw requested a review from a team as a code owner June 14, 2026 23:59

@devin-ai-integration devin-ai-integration 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.

✅ Devin Review: No Issues Found

Devin Review analyzed this PR and found no bugs or issues to report.

Open in Devin Review

@theomonnom

Copy link
Copy Markdown
Member

We will need to bump python-sdks/livekit-protocol as well

Comment thread livekit-agents/livekit/agents/voice/events.py Outdated
devin-ai-integration[bot]

This comment was marked as resolved.

@devin-ai-integration devin-ai-integration 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.

Devin Review found 1 new potential issue.

Open in Devin Review

Comment on lines +124 to +126
await ctx.update(
"Thanks for providing your email address, we are confirming the booking now."
)

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.

🟡 ctx.update() with email-specific message runs unconditionally, even when email was already known

The new await ctx.update("Thanks for providing your email address, we are confirming the booking now.") at line 124 is placed outside the if self._user_email is None: block (line 115). On a second flight booking, the email collection is skipped (email already cached in self._user_email), but this update still fires, telling the LLM "Thanks for providing your email address" when no email was just provided. The LLM would then relay a misleading message to the user about an email they didn't just give.

Prompt for agents
The ctx.update() call at line 124-126 is at the same indentation level as the `if self._user_email is None:` block, so it always executes. It should either be indented one level deeper (inside the if block, after line 123) so the "Thanks for providing your email address" message is only sent when the email was actually just collected, or the message should be changed to something appropriate for both cases (e.g. "Confirming the booking now.").
Open in Devin Review

Was this helpful? React with 👍 or 👎 to provide feedback.

@longcw longcw requested review from a team and theomonnom June 16, 2026 08:34
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