Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 21 additions & 0 deletions packages/uipath/tests/cli/chat/test_voice_bridge.py
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,27 @@ async def test_session_ended_preserves_payload_opaquely(self) -> None:
assert session.end_detail["callContext"]["id"] == "CA123"
assert session.end_detail["endedBy"] == "agent"

async def test_session_ended_preserves_output_envelope(self) -> None:
"""The voice outputs envelope must reach the job runtime untouched."""
session = _make_session()
envelope = {
"fields": {"caller_name": "Ada", "callback_requested": None},
"status": "extracted",
"extracted": True,
}
payload = {
"callEnded": True,
"endedBy": "agent",
"reason": "agent_completed",
"endToolCalled": True,
"output": envelope,
}

await session._handle_session_ended(payload)

assert session.end_detail["output"] == envelope
assert session.end_detail["endToolCalled"] is True
Comment on lines +93 to +94

async def test_session_ended_non_dict_payload_is_empty_detail(self) -> None:
session = _make_session()
await session._handle_session_ended("not-a-dict")
Expand Down
Loading