Talking with a Session: a live voice drives the Session underneath
proposed Architecture decision record 0033
A spike. Talking is a good way to drive an agent: say what you want, hear what it did, answer its question, without typing. OpenAI’s GPT-Live holds a spoken conversation over WebRTC, and in its client delegation mode it hands every piece of work to the application. A Session’s agent is that work. So the voice talks, and the Session does what it is asked, as it does a typed prompt.
- Any Session its Creator drives. While the prompt is empty, the Composer’s Send gives way to a waves button that starts a call, for the Creator alone, since what they say prompts the Session (ADR 0026). While the call is up, a bar floats over the Composer: Live and how long, bars that move with what either side says (still under reduced motion), the voice’s last words, and its settings, mute and a red hang-up.
- The Hub starts it, and then stays out. The browser makes a WebRTC offer, with its microphone and the
oai-eventsdata channel, and posts it toPOST /sessions/<id>/voice. The Hub starts the voice session with the Creator’s own Connected provider for OpenAI, refreshed as the Gateway does, and answers with OpenAI’s SDP. The credential never reaches the browser. Audio and events then go between the browser and OpenAI. - Two GPT-Lives, and a connection of its own. OpenAI’s API (
POST /v1/live/sessions,gpt-live-1) takes an API key alone. kndl’s own ChatGPT sign-in, OpenAI’s Sign in with ChatGPT for apps (resource=https://api.openai.com/v1, scopechatgpt.tokens.use.direct), is for the Responses API alone, so both that endpoint and ChatGPT’s backend answer it 401. GPT-Live on a ChatGPT plan,gpt-live-1-codex, takes the Codex CLI’s sign-in (clientapp_EMoamEEZ73f0CkXaXp7hrann), as OpenClaw uses it. So a Member who wants it opts in to a live voice connection: that sign-in, by device code since the Hub’s loopback can’t be reached from their browser, kept apart from their Connected providers (LiveVoiceConnections.ts). It runs no Models and reaches no Gateway. Its tokens are encrypted, redacted and refreshed as a Connected provider’s are. With it, the Hub callsPOST https://chatgpt.com/backend-api/codex/realtime/calls?intent=quicksilver&architecture=avas,{sdp, session}in and the SDP answer out, with the account from the token’s claims inchatgpt-account-idandOpenAI-Alpha: quicksilver=v2. A 401 has it refreshed and the call sent once more. The two GPT-Lives have their own voices, and their data channels speak different events: the API’ssession.*.append, and Codex’sdelegation.context.appendwith aspeakableorcommentarychannel, whosedelegation.createdalso names the work. The answer to the browser says which. - The voice is told what it is. Its instructions say it does no work itself, and delegates anything to be done, checked or changed, and anything about the code, the Session or the agent. It can’t see them, so it never answers about them itself or makes up what the agent did, and never says it passed something on unless it delegated it. They carry the Session’s latest Turns, as
session_historygives them, as background to follow the conversation by, not to answer from. The call bar shows the last thing the voice really handed to the Session, so a hand-off it only claims shows as none. A delegation GPT-Live addresses to anything but kndl, which its configuration rules out, is logged in the browser’s console. - The bridge, in the browser. What the person says arrives as transcript deltas. When GPT-Live delegates, what they said since the last delegation goes to the Session as their prompt, or as their reply to its Open question while it asks one. The bridge follows the Turn that prompt started, by the id the Prompt queue gives the prompt, which its Turn carries; else by a Turn since then whose prompt holds its words, as one a background agent’s notification starts with the prompt riding along. Neither needs the browser’s clock to agree with the Hub’s. While it runs, GPT-Live is told quietly what the agent is doing, every 20 seconds at most (
session.thinking.append). When it ends, it is given the agent’s answer, its text after its last tool call, to say (session.commentary.append). A question the agent asks is given to it to ask. Each append is at most 500 bytes, as OpenClaw found: a longer one is refused, so a longer message, the agent’s answer up to 1800 characters, goes in several, split at spaces. Its instructions say what each channel means, as OpenClaw’s do, and that the agent’s progress, answers and questions are never requests to delegate. - A live voice setting per Member. On the Account page, a Member picks the live voice Model they talk with, and its voice. Until they choose, it is the first they have what it needs for: the live voice connection, then an OpenAI API key. A list of Models kndl knows, each with its Provider and what it needs, holds the two GPT-Lives for now. Another Provider’s Model, such as xAI’s, joins the list with its own way of starting a session.
Amendment: clean prompts
In Talk only, the agent got what was said word for word: “Uh, I’m just looking at this code and I was wondering if uh if we had any failing tests perhaps.” It should get what was meant: “Check whether any tests are failing in the codebase.” Codex and OpenClaw hand their agent the words and the conversation around them, and let it read them; kndl’s prompts are in everyone’s transcript, so they are written cleanly first.
- The bridge keeps both sides of what was said since the last hand-off, the person’s words and the voice’s, a line a turn. At a hand-off it posts them to
POST /sessions/<id>/voice/prompt, with the task as GPT-Live named it, if it did, and the agent’s question, if what was said answers it. - The Hub writes the prompt with the Creator’s fastest-sounding OpenAI Model (a mini, nano or Luna, else their first) on their own OpenAI connection, kndl’s ChatGPT sign-in included, which takes the Responses API: streamed and not stored, with none of the fields a ChatGPT sign-in refuses, as pi sends it, at the Model’s least thinking. Its instructions: the one prompt the person means, as they’d type it; every detail that matters kept; fillers dropped; nothing added; a question kept a question; an answer to the agent’s question written as one. The Session’s latest Turns are its background, so “that test” can be named.
- Never lost: without an OpenAI connection, a refusal, or no prompt within 10 seconds at the Hub or 12 in the browser, what was said goes as it is. When nothing came through at all, the voice is told to ask again, out loud.
Amendment: a reasoning model behind the voice (spike)
Talking is the easy part. What you want is a voice you can think out loud with, that turns the conversation into the right work for the Session’s agent, and acts on what comes back. GPT-Live has a mode for that: Responses delegation, where it hands what you ask to a stronger reasoning model of OpenAI’s, which can search the web and call function tools the app runs. So the voice has three layers now:
- GPT-Live holds the conversation, and hands anything that needs thought or action to the reasoning model.
- The reasoning model (
gpt-6-lunaby default, orgpt-6-solfor harder work, as OpenAI’s guide suggests) thinks, searches the web, and drives the Session’s agent with five kndl tools:send_to_agent,agent_status,read_agent_history,answer_agent_questionandstop_agent(LiveVoiceTools). Its instructions say to write the agent a clear, self-contained instruction, not a transcript, and carry the Session’s latest Turns. - The Session’s agent does the code work, as before.
The browser runs the tools, as the Creator, on the Session the call is with (voiceTools.ts): a function call comes as response.event wrapping response.output_item.done, and its output goes back as response.item.create, then response.create. send_to_agent returns at once; the bridge follows the Turn it started, and says its answer to the conversation as a whole (delegation_id null) when it ends, as it does for a prompt in the other mode. So “stop” and “how’s it going?” are tools now, not prompts that queue.
It is the default for GPT-Live 1 (API key), as With a reasoning model on the Account page, beside Talk only, the mode above. A refusal (responses_validation_failed, or a tool left unanswered) shows in a toast, saying to try Talk only, and so does a delegation to the reasoning model with no sign of it at work within 30 seconds.
Not through ChatGPT. The first live test, on gpt-live-1-codex, hung: GPT-Live delegated, said “still waiting” for minutes, and nothing reached the agent. Codex’s own client (openai/codex, protocol_frameless_bidi.rs) shows why: on ChatGPT’s backend it reads session.*, *_transcript.added, turn.done and delegation.created alone, with client delegation and its own agent as the backend. No reasoning model’s tool calls come through there. So that Model is Talk only, whatever the setting, and the Account page says a reasoning model needs the API key. Codex hands its agent the voice’s words, with both sides of the conversation since the last hand-off (user: …, assistant: …), and lets its agent read them, as OpenClaw does.
This reverses the first considered option below, Responses delegation, for the goal it serves: a conversation that ends up driving the agent, not just relaying to it.
Considered options
- kndl’s own ChatGPT sign-in for voice too. Tried first: both GPT-Live endpoints refuse it.
- The Codex sign-in as a Connected provider (pi-ai’s
openai-codex). Its Models would join the Member’s pi Models beside OpenAI’s own sign-in’s, and the Gateway would carry it. Voice needs neither. - Responses delegation, GPT-Live’s other mode, with kndl’s actions as function tools. A second model would think about the work on OpenAI’s side before passing it on, and the browser would run the tools anyway. The Session’s agent is already the brain.
- The Realtime API’s GA models (
/v1/realtime/calls) in place of GPT-Live. They speak another event protocol, with tools rather than delegation. A second protocol for the same thing, later if wanted. - Audio through the Hub. Every word would pass through the Hub for no gain: only starting the session needs the credential.
Consequences
- What is said is a prompt from the Creator. It shows in the transcript as their prompt, in their words as transcribed, not marked as spoken.
- The live voice connection is unofficial. It signs in as the Codex CLI and calls a backend that isn’t a published API, as OpenClaw does, so OpenAI may change or stop it without notice. The Account page says so before the Member signs in. The API key path is OpenAI’s documented one.
- The Session must be open. The bridge follows the Session through the web UI’s transcript of it, so leaving the Session hangs up.
- It costs the Creator. GPT-Live is billed per minute of the call, on their OpenAI account or plan.
Rendered from docs/adr/0033-talking-with-a-session.md in the repository.
kndl is an independent project. It is not affiliated with or endorsed by Anthropic. Claude and Claude Code are trademarks of Anthropic, PBC. About kndl