docs: document auto_previous_response_id and model_refusal error handler#3383
Open
ioleksiuk wants to merge 1 commit into
Open
docs: document auto_previous_response_id and model_refusal error handler#3383ioleksiuk wants to merge 1 commit into
ioleksiuk wants to merge 1 commit into
Conversation
Two pieces of doc drift accumulated: - PR openai#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. - PR openai#3057 added `model_refusal` as a supported key in `RunErrorHandlers`, but four docstrings still claim "Currently supports max_turns" only (three in `run.py`, one in `run_config.py:RunOptions.error_handlers`). Add the missing `auto_previous_response_id` entry to each `Args:` block and update the `error_handlers` description to list both handler kinds.
seratch
requested changes
May 13, 2026
Member
seratch
left a comment
There was a problem hiding this comment.
We'd like to have only the auto_previous_response_id documentation
Comment on lines
+242
to
+243
| error_handlers: Error handlers keyed by error kind. Currently supports | ||
| max_turns and model_refusal. |
Member
There was a problem hiding this comment.
This could be outdated. We'd like to avoid listing the possible values here.
Suggested change
| error_handlers: Error handlers keyed by error kind. Currently supports | |
| max_turns and model_refusal. | |
| error_handlers: Error handlers keyed by error kind. |
|
|
||
| error_handlers: NotRequired[RunErrorHandlers[TContext] | None] | ||
| """Error handlers keyed by error kind. Currently supports max_turns.""" | ||
| """Error handlers keyed by error kind. Currently supports max_turns and model_refusal.""" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Two pieces of doc drift accumulated in the public `Runner` methods:
This PR adds the missing `auto_previous_response_id` entry to each `Args:` block and updates the `error_handlers` description to list both handler kinds.
Test plan
```
$ uv run python -c "
import inspect
from agents import Runner
for name in ('run', 'run_sync', 'run_streamed'):
doc = inspect.getdoc(getattr(Runner, name)) or ''
print(name, 'auto_previous_response_id:', 'auto_previous_response_id' in doc,
'model_refusal:', 'model_refusal' in doc)
"
run auto_previous_response_id: True model_refusal: True
run_sync auto_previous_response_id: True model_refusal: True
run_streamed auto_previous_response_id: True model_refusal: True
```
Issue number
N/A — found during a docstring/signature drift audit following recent param/handler additions.
Checks