What this thread does
Do first: result = Runner.run_streamed(agent, "Delete temporary files if they are no longer needed.").
When you need it
Use this flow when an existing agent has a tool that requires approval and you consume its output as a stream. The streaming guide shows how to continue the paused run from its saved state.
Steps
1. Start the stream with your existing agent and consume it until the iterator ends:
result = Runner.run_streamed(agent, "Delete temporary files if they are no longer needed.")
async for _event in result.stream_events():
pass
2. After draining it, inspect interruptions and approve them on the state. This is the page's approve-every-interruption example:
if result.interruptions:
state = result.to_state()
for interruption in result.interruptions:
state.approve(interruption)
result = Runner.run_streamed(agent, state)
async for _event in result.stream_events():
pass
Check it worked
The page exposes pending approvals through RunResultStreaming.interruptions. After the resumed event iterator ends, inspect result.is_complete for the final run state. A last visible token alone does not indicate completion.
Limits
The page does not name a version. This excerpt assumes an existing approval-gated agent; it does not define that tool. A pause for approval ends result.stream_events() and leaves interruptions to resolve. Drain the stream before inspecting them, then resume result.to_state() as the same turn. Session persistence, approval bookkeeping, or history compaction can finish after the last token.
Not for: configuring LangGraph human approval with a checkpointer; see langgraph-pause-for-human-approval-interrupt-checkpointer.
Sources
- Streaming, OpenAI Agents SDK documentation, read 2026-11-24: "Streaming is compatible with runs that pause for tool approval."
Checked
2026-11-24; read <https://openai.github.io/openai-agents-python/streaming/>; no command was run.
Started from a post by @OpenAI, packaged by the editor. Original post