Skip to content

feat(voice): VoiceToolCallSession + extract CAS URL/auth helpers#1559

Draft
JoshParkSJ wants to merge 6 commits intomainfrom
josh/voice-urt
Draft

feat(voice): VoiceToolCallSession + extract CAS URL/auth helpers#1559
JoshParkSJ wants to merge 6 commits intomainfrom
josh/voice-urt

Conversation

@JoshParkSJ
Copy link
Copy Markdown
Contributor

@JoshParkSJ JoshParkSJ commented Apr 11, 2026

Summary

  • Adds `VoiceToolCallSession` (new `packages/uipath/src/uipath/_cli/_chat/_voice_session.py`): persistent socket.io connection to CAS that receives batched `voice_tool_call` events, dispatches each call to a caller-supplied handler in parallel, and emits one `voice_tool_result` per `callId`. Exits on `voice_agent_completed` or socket disconnect, with a shutdown drain for in-flight tool tasks.
  • Extracts `build_cas_url(context)` and `build_cas_auth_headers(context)` from the inline logic in `get_chat_bridge()`. `get_chat_bridge()` now delegates to these helpers — no behavior change.
  • Both URL/auth helpers exported from `all` so the voice session runtime in `uipath-agents-python` can reuse them directly, avoiding duplicating the URL construction and auth header logic.

Context

The voice URT session runtime (`uipath_agents/voice/session.py`, see UiPath/uipath-agents-python#419) connects to CAS via the same socket.io endpoint as the chat bridge. Rather than duplicating the URL + auth setup, it calls `build_cas_url` and `build_cas_auth_headers` from this package, and drives the tool-call loop through `VoiceToolCallSession`.

Paired with: UiPath/AgentInterfaces#911 (CAS side) and UiPath/uipath-agents-python#419 (agent wiring).

Test plan

  • Existing conversational agent flows unaffected (`get_chat_bridge` behavior unchanged)
  • `build_cas_url` returns correct URL/path for both `CAS_WEBSOCKET_HOST` (local dev) and `UIPATH_URL` (prod)
  • `build_cas_auth_headers` returns correct headers with token, tenant, org, and conversation ID
  • `VoiceToolCallSession`: parallel tool calls dispatch concurrently; `voice_agent_completed` triggers drain + disconnect; connect timeout raises `VoiceToolCallSessionError`

@github-actions github-actions bot added test:uipath-langchain Triggers tests in the uipath-langchain-python repository test:uipath-llamaindex Triggers tests in the uipath-llamaindex-python repository labels Apr 11, 2026
@JoshParkSJ JoshParkSJ changed the title refactor(bridge): extract build_cas_url and build_cas_auth_headers from get_chat_bridge feat(voice): VoiceToolCallSession + extract CAS URL/auth helpers Apr 18, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

test:uipath-langchain Triggers tests in the uipath-langchain-python repository test:uipath-llamaindex Triggers tests in the uipath-llamaindex-python repository

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant