Orply.

Client Delegation Lets Applications Control Context and Backend Results

OpenAIFriday, December 4, 20264 min read

OpenAI’s client-delegation lesson shows how an application can connect GPT Live to an existing backend agent while retaining control over the handoff. The application assembles the context sent to the backend, tracks delegation requests over a sideband connection, and decides what updates and results return to GPT Live. That lets backend work continue alongside the live conversation while the application shapes what the model and user receive.

Client delegation keeps the application in control

Client delegation connects GPT Live to an agent or workflow an application already uses. A customer who currently interacts with that assistant through chat, for example, can also speak to it. GPT Live’s prompt should explain what the backend can do and when to delegate; when it needs that help, it asks the application to handle the request.†

The defining change from responses delegation is who manages the handoff. In responses delegation, the integration supplies conversation context and returns results automatically. With client delegation, the application handles both steps. That lets it decide what context reaches the backend and what results come back to GPT Live.

In the lesson’s example, the existing agent runs on a server while the browser handles live audio. The server therefore needs its own connection to the same GPT Live session, so it can receive delegation requests and return results. The application provides that connection through a sideband WebSocket. The browser and server have distinct roles: the browser carries the live audio interaction, while the server connects the existing agent to the session.

A delegation request carries an ID, not the conversation

When GPT Live delegates, the event includes an identifier for the request but not the context of what the user said. The server must assemble that context itself: transcripts from both the user and GPT Live, combined with any task-relevant information the application already holds. The request ID identifies which delegation is being handled; it is not a substitute for the conversation history or a complete description of the task.

Once it has gathered the context, the server can call its agent and start work while the conversation continues. Updates travel back to GPT Live over the sideband connection, and each update includes the delegation ID so the model can associate it with the right request. This means the server can keep the live exchange moving while backend work proceeds, rather than waiting for all work to finish before communicating.

That separation matters in practice. The delegation event signals that work is needed; it does not supply a complete brief. The application is responsible for constructing one from the conversation and its own task information. In the ordering example, the user asks for two orders of butter chicken for delivery. The server would need to gather the relevant user and GPT Live transcripts, together with any other information it already has about the task, before passing context to its agent.

Updates can inform, speak, or steer

The server has three kinds of session update available, depending on how GPT Live should use the information. These updates are not interchangeable: one can add context for later replies without prompting an announcement, another can give the user something to hear, and a third can guide the model’s response.

A session.thinking.append update gives GPT Live context without asking it to announce the information. The model can use that context in later replies. In the ordering example, it could note that the order still needs a spice level, sides or drinks, and a delivery time and address. The update keeps GPT Live informed while the server or agent continues working.

A session.commentary.append update is information the user should hear. It can carry a useful progress update or the final result. For example, the server can send the suggestion to ask which spice level the customer prefers, and GPT Live can then ask the customer directly.

A session.instructions.append update guides how GPT Live responds. The example instruction is to ask one question at a time. Together, the three update types distinguish between context for the model, content intended for the user, and directions for the model’s behavior. As the work progresses, the server can choose the update type that fits what it needs GPT Live to do, and associate each update with the relevant delegation ID.

The application can inspect results before returning them

Client delegation leaves room for the application to check an agent’s answer before passing it back to GPT Live. It can also combine several results into a single update. The application can therefore shape what returns to the live session: it need not forward an agent’s answer automatically or unchanged. That is useful when the backend produces multiple pieces of information or when the application wants to review the result before GPT Live uses it in the conversation.

The frontier, in your inbox tomorrow at 9:00.

Sign up free. A Brief lands every morning and every evening at 9:00 Eastern. No credit card.

Sign up free