Back to news
API

OpenAI Agents SDK v0.15.0

### Better model refusal handling In this version, model refusals are now surfaced explicitly as `ModelRefusalError` instead of being treated as empty text output or, for structured outputs, causing the run loop to retry until `MaxTurnsExceeded`

OpenAIAPI

OpenAI Agents SDK v0.15.0

apiopenaisdkreleasechangelog

Key Changes

Better model refusal handling

In this version, model refusals are now surfaced explicitly as ModelRefusalError instead of being treated as empty text output or, for structured outputs, causing the run loop to retry until MaxTurnsExceeded.

This affects code that previously expected a refusal-only model response to complete with final_output == "". To handle refusals without raising, provide a model_refusal run error handler:

result = Runner.run_sync(
    agent,
    input,
    error_handlers={"model_refusal": lambda data: data.error.refusal},
)

For structured-output agents, the handler can return a value matching the agent's output schema, and the SDK will validate it like other run error handler final outputs.

What's Changed

Documentation & Other Changes

New Contributors

Full Changelog: https://github.com/openai/openai-agents-python/compare/v0.14.8...v0.15.0