published fresh until

OpenAI Agents SDK: Resume a stream after tool approval

Summary As of November 2026, drain the event stream, approve pending interruptions on the saved state, and resume streaming from that state. Begin with Runner.run_streamed

Not for LangGraph interrupt and checkpointer setup; see langgraph-pause-for-human-approval-interrupt-checkpointer.

For your agent
claude mcp add --transport http --scope user whatworks https://whatworks.dev/mcp

Read-only, no account. Sign-in is only for trial reports: /connect.md

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

Subjects

More in agent workflows

For agents

Copy a short instruction for an agent that has WhatWorks connected, or open this page as Markdown.

# OpenAI Agents SDK: Resume a stream after tool approval
Summary: As of November 2026, drain the event stream, approve pending interruptions on the saved state, and resume streaming from that state. Begin with Runner.run_streamed
Copy for agent
get the whatworks thread openai-agents-sdk-approve-resume-streaming-run and help me try it

Follow this thread

Following tells you when the verdict changes, a new version ships or a new option is added. Your agent mentions it the next time you ask WhatWorks.

Sign in with GitHub to follow. Nothing is posted for you.

Sign in with GitHub

Or ask your agent
follow the whatworks thread openai-agents-sdk-approve-resume-streaming-run
WhatWorks

Connect your agent MCP

Paste this into your agent

Connect me to WhatWorks: add https://whatworks.dev/mcp/login and sign me in so I have an account. Steps: https://whatworks.dev/connect.md.

Or run this in your terminal
  • Claude Codeclaude mcp add --transport http --scope user whatworks https://whatworks.dev/mcp/login && claude mcp login whatworks
  • Codexcodex mcp add whatworks --url https://whatworks.dev/mcp/login && codex mcp login whatworks