From b9c37e88d55e4125fa981667d713204b91b0dafa Mon Sep 17 00:00:00 2001 From: Illia Oleksiuk Date: Tue, 12 May 2026 16:46:59 -0700 Subject: [PATCH] docs: document auto_previous_response_id and drop stale error_handlers value list PR #2117 added the `auto_previous_response_id` parameter to `Runner.run`, `Runner.run_sync`, and `Runner.run_streamed` signatures but did not document it in the `Args:` blocks (parameter appears in `inspect.signature` but not in `inspect.getdoc`). Add the missing `auto_previous_response_id` entry to each `Args:` block. Drop the "Currently supports max_turns" enumeration from the `error_handlers` docstrings (3 in `run.py`, 1 in `run_config.py:RunOptions.error_handlers`) to avoid documenting a list that will drift again as more handler kinds are added. --- src/agents/run.py | 15 ++++++++++++--- src/agents/run_config.py | 2 +- 2 files changed, 13 insertions(+), 4 deletions(-) diff --git a/src/agents/run.py b/src/agents/run.py index d05878e5d2..0e9818591f 100644 --- a/src/agents/run.py +++ b/src/agents/run.py @@ -239,10 +239,13 @@ async def run( Pass ``None`` to disable the turn limit. hooks: An object that receives callbacks on various lifecycle events. run_config: Global settings for the entire agent run. - error_handlers: Error handlers keyed by error kind. Currently supports max_turns. + error_handlers: Error handlers keyed by error kind. previous_response_id: The ID of the previous response. If using OpenAI models via the Responses API, this allows you to skip passing in input from the previous turn. + auto_previous_response_id: If True, enable Responses API response chaining + automatically for the first turn even when no + ``previous_response_id`` is supplied yet. conversation_id: The conversation ID (https://platform.openai.com/docs/guides/conversation-state?api-mode=responses). If provided, the conversation will be used to read and write items. @@ -325,10 +328,13 @@ def run_sync( Pass ``None`` to disable the turn limit. hooks: An object that receives callbacks on various lifecycle events. run_config: Global settings for the entire agent run. - error_handlers: Error handlers keyed by error kind. Currently supports max_turns. + error_handlers: Error handlers keyed by error kind. previous_response_id: The ID of the previous response, if using OpenAI models via the Responses API, this allows you to skip passing in input from the previous turn. + auto_previous_response_id: If True, enable Responses API response chaining + automatically for the first turn even when no + ``previous_response_id`` is supplied yet. conversation_id: The ID of the stored conversation, if any. session: A session for automatic conversation history management. @@ -402,10 +408,13 @@ def run_streamed( Pass ``None`` to disable the turn limit. hooks: An object that receives callbacks on various lifecycle events. run_config: Global settings for the entire agent run. - error_handlers: Error handlers keyed by error kind. Currently supports max_turns. + error_handlers: Error handlers keyed by error kind. previous_response_id: The ID of the previous response, if using OpenAI models via the Responses API, this allows you to skip passing in input from the previous turn. + auto_previous_response_id: If True, enable Responses API response chaining + automatically for the first turn even when no + ``previous_response_id`` is supplied yet. conversation_id: The ID of the stored conversation, if any. session: A session for automatic conversation history management. diff --git a/src/agents/run_config.py b/src/agents/run_config.py index 572e62ed17..a2058c2631 100644 --- a/src/agents/run_config.py +++ b/src/agents/run_config.py @@ -349,7 +349,7 @@ class RunOptions(TypedDict, Generic[TContext]): """The session for the run.""" error_handlers: NotRequired[RunErrorHandlers[TContext] | None] - """Error handlers keyed by error kind. Currently supports max_turns.""" + """Error handlers keyed by error kind.""" __all__ = [