Repository navigation
feat(voice): add GPT-Live 1.1 as a Realtime provider - #434
Conversation
There was a problem hiding this comment.
Checked the new Live provider, its session and conversation, and the code moved out of VoiceConversation into ModelAudio, RoomReadings, VoiceTools and run_realtime_socket. The extracted modules keep the old behaviour: the reader loops, the tool-run bookkeeping and the roster logic match line by line. Endpoint resolution, the Responses usage field name and the instruction cut are correct.
Two findings block the merge:
- With
REALTIME_PROVIDER=openai-live, dictation connects to/v1/realtimewithmodel=gpt-live-1.1, a model that the PR says serves only/v1/live/sessions. - Tool calls from a Live session do not check
INFERENCE_GATE, so the agent keeps running tools during a secure takeover of the computer. The Realtime provider refuses at that point.
Counts: 2 Major, 3 Minor, 1 Nit.
Not on a diff line:
- Minor: the voice chat and meeting telemetry events (
voice_chat_service.rs:1153-1161,meeting_bot_service.rs:1407-1419) carry no prop that names the Realtime provider, so a Live call cannot be told apart from a Realtime call in product data. They also reportresponse_modefor a Live call, where the mode does not apply. Add arealtime_providerprop fromRealtimeProviderName::as_str(). - Nit: in the PR body, "ddslop leftovers" is a term a reader cannot parse.
Not verified: this review read the code only; it did not build the tree, run the tests, or call the OpenAI APIs. The Live API's handling of a partial session.update, a response.create sent while a function call has no output, and whether the Realtime endpoint refuses gpt-live-1.1 are unverified; finding 1 relies on the PR's own statement about the model.
There was a problem hiding this comment.
🟡 Changes recommended
Live tool dispatch and backend continuations bypass the inference gate during secure sign-in, allowing new work during a protected window.
6 open issues
Live tool dispatch bypasses the secure-window inference gate · New Screen-recording narration audio is never forwarded or preserved · New Hanging up can leave a tool call unanswered and block the summary · New Recording completion requests a response before queued work finishes · New Dictation uses a model incompatible with the Realtime endpoint · New Web tests omit Live provider, dictation, and narration flows · New
What changed in this PR
Adds optional GPT-Live 1.1 support through the existing voice-provider interface, with autonomous turn-taking and a separate reasoning backend.
Changes:
- Adds Live session handling, tool delegation and configuration.
- Shares socket handling, audio conversion and room state between providers.
- Adds protocol tests, backend usage accounting and operator documentation.
| File | Description |
|---|---|
docs/voice-meetings.md |
Documents Live turn-taking and billing. |
docs/voice-chat.md |
Describes Live conversation behavior. |
docs/configuration.md |
Documents provider and backend settings. |
backend/src/services/meeting/realtime_usage.rs |
Accounts for backend cached tokens. |
backend/src/lib/realtime_providers/voice_tools.rs |
Extracts shared tool execution. |
backend/src/lib/realtime_providers/voice_session.rs |
Shares instruction/catalog assembly. |
backend/src/lib/realtime_providers/room_readings.rs |
Extracts speaker and roster state. |
backend/src/lib/realtime_providers/openai_realtime/voice_conversation/tests.rs |
Adjusts imports for extracted helpers. |
backend/src/lib/realtime_providers/openai_realtime/voice_conversation.rs |
Uses shared conversation helpers. |
backend/src/lib/realtime_providers/openai_realtime/realtime_session.rs |
Uses shared socket handling. |
backend/src/lib/realtime_providers/openai_realtime/openai_endpoint.rs |
Adds Live URL resolution and socket runner. |
backend/src/lib/realtime_providers/openai_realtime/dictation_session.rs |
Uses shared socket handling. |
backend/src/lib/realtime_providers/openai_live/openai_live_provider.rs |
Implements the Live provider. |
backend/src/lib/realtime_providers/openai_live/mod.rs |
Exports Live modules. |
backend/src/lib/realtime_providers/openai_live/live_session/tests.rs |
Tests Live protocol exchanges. |
backend/src/lib/realtime_providers/openai_live/live_session.rs |
Implements Live transport and delegations. |
backend/src/lib/realtime_providers/openai_live/live_conversation/tests.rs |
Tests conversation lifecycle and tools. |
backend/src/lib/realtime_providers/openai_live/live_conversation.rs |
Connects Live to voice-session behavior. |
backend/src/lib/realtime_providers/model_audio.rs |
Extracts shared audio conversion. |
backend/src/lib/realtime_providers/mod.rs |
Exports provider and shared modules. |
backend/src/lib/realtime_providers/get_realtime_provider.rs |
Registers Live provider selection. |
backend/src/config/tests.rs |
Tests Live defaults and overrides. |
backend/src/config.rs |
Adds Live selection and model settings. |
.env.example |
Shows Live configuration options. |
Review effort: Balanced
| fn create(name: RealtimeProviderName) -> Box<dyn RealtimeProvider> { | ||
| match name { | ||
| RealtimeProviderName::OpenaiRealtime => Box::new(OpenAiRealtimeProvider), | ||
| RealtimeProviderName::OpenaiLive => Box::new(OpenAiLiveProvider), |
There was a problem hiding this comment.
Left open for the PR owner. The web suite's mock voice server speaks only Realtime frames. An openai-live configuration needs a second mock for the Live protocol (session.start, response.event delegations, session.thinking.append) and another runtime boot, which is a sizeable e2e addition. The Live protocol paths in this PR (tool runs, held items, the summary, narration replay, the sign-in refusal) have unit tests against a local WebSocket server, with frames shaped like the ones a real gpt-live-1.1 session sent.
jansav
left a comment
There was a problem hiding this comment.
Verdict: Needs fixes: 4 findings (1 critical, 3 should fix).
Problem: Voice chats and meetings could only run on the OpenAI Realtime API. This PR adds GPT-Live 1.1 as a second Realtime provider. With it the model takes its own turns, stops by itself when someone talks over it, bills the voice per minute, and runs the agent's tools on a full Responses reasoning model.
Approach: A new openai-live provider sits behind the existing RealtimeProvider seam. It has its own Live session (the session.start / delegation protocol, holding backend items while function calls wait for output) and a conversation that drops the response policy and barge-in logic. The socket runner, audio conversion, room readings and tool execution were moved out of the Realtime conversation so both providers share them, and dictation stays on the Realtime transcriber.
Trade-off: There are now two voice providers with different protocols to maintain behind one seam. On openai-live, the spending view does not show the per-minute voice cost, and voice_start's mode and the meeting response modes do nothing, so operators lose those controls.
Reviewed by the review routine at 46dc373.
REALTIME_PROVIDER=openai-live gives the agent its voice on OpenAI's Live API (/v1/live/sessions, gpt-live-1.1), on the same endpoint and credential as openai-realtime. The model takes its own turns and hands the agent's tools to a Responses backend model, OPENAI_LIVE_BACKEND_MODEL (default gpt-6-sol), whose function calls run as the agent's real tools. Dictation keeps the Realtime transcriber. - LiveSession speaks the protocol: session.start, context as thinking and instructions appends, backend items, tool outputs continued with response.create once every call of a response has one, and the end-of-call summary as a text request on the backend. - The voice model is told to hand every tool-shaped request to the backend; a live call without that rule answered "I'll remember that" and saved nothing. - The voice's copy of the instructions keeps under the API's 16,384-token cap by cutting the middle on whole lines; the backend always has the whole text. - The backend's tokens are priced from the Responses usage, and the voice's billed seconds at $0.05 a minute from each session.usage.updated, since models.dev lists no price for gpt-live-1.1. - Shared with the Realtime provider instead of copied: the socket runner (run_realtime_socket, also used by dictation), RoomReadings, ModelAudio, VoiceTools and VoiceSessionOptions::instructions_with_catalog. - OPENAI_REALTIME_MODEL defaults to gpt-live-1.1 for openai-live. Signed-off-by: Panu Horsmalahti <phorsmalahti@mirantis.com>
46dc373 to
ea703c5
Compare
msa0311
left a comment
There was a problem hiding this comment.
Three findings that the existing threads don't cover: two in the Live provider and one docs line. The open threads from jansav, Copilot and the bot still stand. The inference-gate bypass is the one that blocks.
Checked and correct: the run_realtime_socket extraction keeps the Realtime and dictation readers' behaviour (error, reset and close paths, and the go gate); live_url_from maps the managed …/realtime mount onto the gateway's …/live/sessions route, which nexus-monorepo serves for both OpenAI and Azure; tokens_of reads the Responses input_tokens_details spelling; voice_instructions cuts only at newline offsets, so it cannot split a UTF-8 character.
…findings - A Live call refuses every tool call while a secure sign-in holds the inference gate (in VoiceTools, so both providers share it), hears silence for that time, and asks the backend for nothing. - OPENAI_LIVE_MODEL names the Live voice model. OPENAI_REALTIME_MODEL stays the Realtime model for every provider, so dictation keeps working on openai-live. - A screen recording's narration is played back to the voice model, since the backend takes no audio (probed: "Audio input is not available"). A recording sent while a call runs is answered after that call's output, not before. - The call summary answers the calls still running, sends the held items and drops the backend's tools first. response.create takes no per-response settings (probed: "Unknown parameter: 'response'"), so effort and token limit are not sent. - The backend's first call pins who the agent answers, as its first words do. - A close the server never answers aborts the reader and reports 1006. - The instructions warning fires on the cut itself. - docs: "Three levers". Signed-off-by: Panu Horsmalahti <phorsmalahti@mirantis.com>
jansav
left a comment
There was a problem hiding this comment.
Verdict: Needs fixes: 1 finding (1 should fix).
Delta: 46dc373 → 68f1dcb. Changed in the PR: .env.example, backend/src/config.rs, backend/src/config/tests.rs, backend/src/lib/realtime_providers/openai_live/live_conversation.rs, backend/src/lib/realtime_providers/openai_live/live_conversation/tests.rs, backend/src/lib/realtime_providers/openai_live/live_session.rs, backend/src/lib/realtime_providers/openai_live/live_session/tests.rs, backend/src/lib/realtime_providers/voice_tools.rs, backend/src/services/meeting/realtime_usage.rs, docs/configuration.md and 1 more.
Problem: Voice chats and meetings could only run on the OpenAI Realtime API. This PR adds GPT-Live 1.1 as a second Realtime provider, where the model takes its own turns and runs the agent's tools on a Responses reasoning model. Since the last review, the PR fixes the gaps found then: the secure sign-in gate, the dictation model, the recording narration, the call summary, and the per-minute voice spend.
Approach: The Live voice model now has its own OPENAI_LIVE_MODEL, so OPENAI_REALTIME_MODEL stays the Realtime model that dictation uses. VoiceTools::start refuses every call while the inference gate is held, for both providers, and Live sends silence in place of the call audio during that time. The summary first settles the running calls and removes the backend's tools. The recording narration is played back to the voice model as input audio, and each billed second the server reports is recorded at a fixed per-minute price.
Trade-off: The per-minute price of the Live voice is a constant in the code, so the spending view goes wrong without warning if OpenAI changes the price. On openai-live, whether a narrated recording gets an answer now depends on the voice model choosing to hand it to the backend.
Reviewed by the review routine at 68f1dcb.
… speech On openai-live, a recording nobody spoke over went the narration path, since the microphone is recorded the whole time and its audio is never empty. The voice model heard silence and nothing asked the backend to answer. A narration now counts only when 200 ms of it is above about -44 dBFS; otherwise the backend is asked to answer, as before. Live streams its output audio in real time, silence included, so a browser call showed the agent speaking for the whole call. The worklet now counts a played voice sample as speech only above about -60 dBFS. Silence is still played, so the timing is unchanged. Signed-off-by: Panu Horsmalahti <phorsmalahti@mirantis.com>
jansav
left a comment
There was a problem hiding this comment.
Verdict: Needs fixes: 1 finding (1 should fix).
Delta: 68f1dcb → 4a4aaac. Changed in the PR: backend/src/lib/realtime_providers/openai_live/live_conversation.rs, backend/src/lib/realtime_providers/openai_live/live_conversation/tests.rs, web/public/voice-worklet.js, web/src/lib/voice-worklet.test.ts.
Problem: On openai-live, a screen recording that nobody spoke over still had microphone audio, so it went down the narration path and got no answer. Also, because Live streams its silences, the browser showed the agent as speaking for the whole call. This delta fixes both problems.
Approach: The backend checks the loudness of the recording's narration (20 ms RMS windows above about -44 dBFS, 200 ms in total). Only a narration that passes is replayed to the voice model; otherwise the backend is asked to answer the pictures. The voice worklet still plays every voice sample, but it marks the agent as speaking only for samples above about -60 dBFS.
Trade-off: Fixed loudness thresholds now decide behavior. Someone who speaks very quietly may get their narration dropped in favor of an answer about the pictures alone. On the Realtime provider, the speaking indicator can now drop during pauses longer than 300 ms inside one reply.
Reviewed by the review routine at 4a4aaac.
msa0311
left a comment
There was a problem hiding this comment.
Ship it.
Re-reviewed 68f1dcbe..4a4aaacb:
- The worklet now plays Live's streamed silence but reports
speakingonly for samples above about -60 dBFS, so the call bar no longer shows "Speaking" for the whole call. The 300 ms hangover still covers the gaps between words. show_recordingreplays the narration only whenholds_speechfinds at least 200 ms of windows above about -44 dBFS. Otherwise it asks the backend to answer, as it does onopenai-realtime.- My three earlier findings are fixed.
Leaving the approval to a human reviewer: 3,590 changed lines outside tests and docs, and jansav's holds_speech finding is still open.
holds_speech counted every loud 20 ms window anywhere in a recording, so a dozen keystrokes or clicks spread over it added up to the 200 ms of speech and the recording got no answer. Speech now has to be one stretch of 10 loud windows, holding at most 40 ms of quiet between syllables; a longer quiet starts the count again. Signed-off-by: Panu Horsmalahti <phorsmalahti@mirantis.com>
jansav
left a comment
There was a problem hiding this comment.
Verdict: Ship it.
Delta: 4a4aaac → d26cf01. Changed in the PR: backend/src/lib/realtime_providers/openai_live/live_conversation.rs, backend/src/lib/realtime_providers/openai_live/live_conversation/tests.rs.
Problem: On openai-live, a screen recording that nobody spoke over but that had clicks or keystrokes could still count as narrated. It then took the narration path and got no answer.
Approach: holds_speech now needs one unbroken stretch of 10 loud 20 ms windows (200 ms). A stretch can hold at most 2 quiet windows (40 ms) for the dips between syllables, and a longer quiet starts the count again. Loud windows spread across the recording no longer add up to speech.
Trade-off: A narration only counts when it has 200 ms of loud audio with no quiet gap longer than 40 ms. Very short or clipped speech, such as a single quick word with long stop closures, can now be treated as no narration, and the recording then gets an answer about its pictures only.
Reviewed by the review routine at d26cf01.



What problem this solves
The voice ran only on
gpt-realtime-2.1. GPT-Live 1.1 (gpt-live-1.1) is a full-duplex voice that takes its own turns and hands work to a backend model, and it serves only/v1/live/sessions, so it needs a provider of its own behind the Realtime provider seam.Why this change was made
An operator can set
REALTIME_PROVIDER=openai-live(voice modelOPENAI_LIVE_MODEL, defaultgpt-live-1.1) and get voice chats and meetings where the agent decides when to speak and stops by itself when talked over. The voice bills per minute instead of per audio token, and the agent's tools run on a full reasoning model (OPENAI_LIVE_BACKEND_MODEL, defaultgpt-6-sol).User impact
REALTIME_PROVIDER=openai-liveis set. It uses the same endpoint and key asopenai-realtime. Dictation keeps the Realtime transcriber.voice_start'smodeand the meeting response modes do not apply: the model decides when to speak.…/live/sessionsbeside…/realtime. Direct OpenAI works now.This is the provider-seam version of the feature #232 built on the TypeScript runtime.
Evidence
I probed the Live API directly before writing the provider: tool calls via
response.item.create+response.create, barge-in,session.thinking/instructions.append,input_imageto the backend, and a text answer for the call summary. The API refuses voice instructions over 16,384 tokens (Instructions must not exceed 16384 tokens.), which is why the voice's copy is cut on whole lines.I then ran this branch's
prism-serverwithREALTIME_PROVIDER=openai-liveagainst the real API, with a WebSocket voice client speaking twosayclips into a call in a new conversation:The agent's audio, transcribed: "Hmm, let me check that real quick. There aren't any files in my workspace right now, so the count is zero. Okay, I'll remember that your favorite color is teal."
memory_entriesthen held "The user's favorite color is teal.", the conversation got its "Voice call summary" message, andllm_callsholds the backend's priced rows with cache reads counted.The first call ran without the delegation rule: the voice said "I'll remember that" and called no tool. Adding the rule fixed it.
For review:
VOICE_USD_PER_MINUTE, from OpenAI's pricing page), because models.dev lists no price forgpt-live-1.1and the catalog prices tokens only. Eachsession.usage.updatedrecords the seconds since the last one as areportedrow. A 37 s call made three rows totalling $0.0308, andGET /agents/spendinglistedgpt-live-1.1at that amount with no unpriced calls. The constant has to be changed by hand if OpenAI reprices.RealtimeSessionandDictationSessiontoo, andRoomReadings,ModelAudioandVoiceToolscame out ofVoiceConversation. Both providers share them.Audio input is not available.). In a probe, a 4.3 s question replayed in one burst was heard and handed to the backend about 2.5 s later. A recording nobody spoke over (no one stretch of 200 ms above about -44 dBFS, with at most 40 ms of quiet in it, so scattered clicks and keystrokes don't count) asks the backend to answer the pictures instead.session.updateofdelegation.responses.toolskeeps the backend's model and instructions (probed), andresponse.createtakes no per-response settings (Unknown parameter: 'response'), so the call summary drops the backend's tools with asession.updatefirst.LiveSessionandLiveConversationover a real local socket with frames shaped as the API sent them.