Repository navigation
fix(simulate): move Retell web calls to the v3 gateway (TH-8763, stacked from #295) - #302
Open
khushalsonawat wants to merge 3 commits into
Open
khushalsonawat wants to merge 3 commits into
khushalsonawat wants to merge 3 commits into
Conversation
Retell refuses POST /v2/create-web-call, so every Retell voice call failed to start. Create v3 calls and connect over WebRTC; errors carry the HTTP status. (cherry picked from commit 5acc227) Signed-off-by: khushalsonawat <khushalsonawat@gmail.com>
…(TH-8763) The smoke job is the only place aiortc is installed, and it didn't run tests/test_retell_webcall_bridge.py, so the v3 web-call tests never ran in CI. Signed-off-by: khushalsonawat <khushalsonawat@gmail.com>
…H-8763) Fixes from the change review of the v3 web-call move: - only the agent-track wait reads as a track timeout; a stalled create or session POST has its own code; - connect() returns once the peer connection is connected, and caller audio queued before that is dropped; - 30 s with no agent audio raises retell_webcall_agent_audio_timeout instead of ending the call as a hangup, and the bridge passes a provider's audio error on instead of swallowing it; - the v2 URL upgrade keeps the configured host and applies to every RetellTargetConfig; - the bridge package loads aiortc only when the Retell connector is used; - ConnectorConfig keeps the API key out of its repr. Tests cover each, plus pacing, the control channel's order, buffer overflow, the request timeout, a closed connection and a media stream error. Refs: TH-8763 Signed-off-by: khushalsonawat <khushalsonawat@gmail.com>
This branch has not been deployed
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.
This is Dileep's commit 5acc227 from #295, cherry-picked onto the #225 branch (
feat/TH-8804-source-subfolder) with him as author. #295 itself is unchanged.Description
Retell no longer accepts
POST /v2/create-web-call, so every Retell voice web call failed to start. Dileep's commit creates calls through Retell's v3 gateway and connects over WebRTC (aiortc). Its errors carry the HTTP status.Type of Change
Changes
src/fi/simulate/simulation/bridge/retell.py: v3 web-call creation and a WebRTC connection;src/fi/alk/harness/call_runner.py: the web-call URL;src/fi/simulate/agent/definition.py: the Retell target config;pyproject.toml: addsaiortc>=1.9,<2;uv.lock;tests/test_retell_webcall_bridge.py.tests/test_retell_webcall_bridge.py. That job is the only placeaiortcis installed, and before this it didn't run the bridge tests.connect()returns once the peer connection is connected, and caller audio queued before that is dropped;retell_webcall_agent_audio_timeout, where it used to end the call as a hangup. The audio bridge now passes a provider's audio error on instead of swallowing it. Only the Retell and Vapi profiles use this bridge, and Vapi's connector doesn't raise there, so no other provider's call ends differently;RetellTargetConfig;aiortconly when the Retell connector is used, so a Vapi or LiveKit run doesn't need it;ConnectorConfigkeeps the API key out of its repr;Known limits
aiortc. Hosted Retell calls need the template rebuilt with it. That waits for the next template rebuild, which waits on future-agi#3954 and the token.hosted_harness_gateway.py:1188in future-agi) lists HTTP hosts only. Media to Retell's ICE/TURN servers may need allowing there. Check this at the template rebuild.avis imported but not declared; it comes in throughaiortcandlivekit-agents. Declaring it needs a re-lock with network. CI installs with pip, so it testsav19.0.2, while the lock pins 17.1.0.stop_reason: provider_disconnected, with the code only in the log. Its cleanup is recorded as failed (bridge_close:RetellWebCallError), as the watchdog's errors already are. Nothing reads those fields.uv lock --check --offlinepasses (295 packages). Theaiortcsplit, 1.15.0 below Python 3.11 and 1.16.0 from 3.11, is the same as in fix(simulate): move Retell web calls to the v3 gateway #295's lock.Testing
aiortcdownloaded.TYPE_CHECKINGimport, the bridge-error test's stub, and the pacing test's lower bound); one more reviewer checked those alone: CLEAR.Related Issues
Refs: TH-8763