REQUIRES_APPROVAL, so the turn pauses until the client replies.
You’ll end up with. An [approval] log line, an auto-approved response via session.respond(...), and a resumed turn that streams to completion.
Conversational agents pause their turn when a tool is gated with
ToolApprovalConfig.REQUIRES_APPROVAL. The paused turn surfaces a
SessionEvent on listen() with
event.type == SessionEventType.APPROVAL_REQUEST. Item 3’s helpers let
you reply on the same session without hand-rolling proto/JSON payloads.
What this demonstrates:
session.respond(event, approved=True)— dispatches on event typesession.respond_approval(event, approved=..., confirm=..., deny_reason=...)- The paused turn resumes and more MESSAGE_DELTA events flow
- A conversational agent whose tool(s) are already gated with
- The Go WS handler’s
send_responsepath landed (v2 item 7). Until
approval_config through
at runtime (the .pyi stub accepts it but the value is dropped). This
example therefore creates the tool without it and expects the agent’s
approval gating to come from the server-side configuration.
Expected output
APPROVAL_REQUEST lands before any TOOL_CALL — session.respond(event, approved=True) is what unblocks the turn so streaming can resume.
See also
Tool approval config
The producer side — gating a tool with
REQUIRES_APPROVAL.Streaming tool events
All other event types you’ll see alongside
APPROVAL_REQUEST.Session reference
respond() and respond_approval() in detail.