Skip to content

openai_agents: support openai-agents 0.23 and 0.24 - #422

Merged
campoy merged 7 commits into
mainfrom
fix/openai-agents-0.24
Nov 10, 2026
Merged

campoy merged 7 commits into
mainfrom
fix/openai-agents-0.24

Conversation

@campoy

@campoy campoy commented Nov 4, 2026 •

Copy link
Copy Markdown
Contributor

What was changed

Can you use the plugin with openai-agents 0.23 or 0.24? Not today: we pin >=0.22,<0.23. This PR widens that to >=0.22,<0.25. No plugin code changes, just the range, the lock, and two tests that pinned 0.22's wording.

  • The openai-agents range goes from >=0.22,<0.23 to >=0.22,<0.25, in the dependencies and the dev group.
  • uv.lock now has openai-agents 0.24.0, and pyjwt 2.15.1, the floor openai-agents 0.23 sets.
  • Two tests stop pinning text that only openai-agents 0.22 gives.

The review rounds added approval fixes that set private Agents SDK state on the plugin's copies of each agent. 2def4f6 reverts them, so this PR is the range change only. #426 fixes approvals another way (more below).

Why?

Anyone on openai-agents 0.23 or 0.24, because they can't install the plugin today. OpenAI's own Temporal sandbox sample is one of them: examples/sandbox/extensions/temporal in openai/openai-agents-python is on 0.24.0, so it's stuck on temporalio 1.34.

What do 0.23 and 0.24 change for us?

Not much. The private SDK code the plugin uses is unchanged in 0.23.1 and 0.24.0: agents.models._openai_shared, Handoff._agent_ref, FunctionTool._agent_instance, RunResultStreaming._stored_exception, the MCP approval internals, the MultiProvider caches, and the asyncio.to_thread calls in agents.tool. The new BaseSandboxSession methods have defaults built on exec, read and write, which the plugin already runs in activities.

Two upstream changes do reach users through the plugin, the same way they reach a stock function_tool:

  • From 0.23, the SDK's default_tool_error_function returns a fixed message without error details (fix(tools): redact default tool failure details openai/openai-agents-python#5112). activity_as_tool and nexus_operation_as_tool use it by default, so for bad arguments the model now gets "An error occurred while running the tool. Please try again." The end-to-end cases in test_openai_tool_argument_errors.py now check only that prefix. test_argument_error_text_matches_function_tool still checks that the text matches a stock function_tool.
  • From 0.24, function_schema reads a docstring with only an Args: section as parameter descriptions, not as text (fix: Preserve parameter descriptions in Args-only docstrings openai/openai-agents-python#5302). Two rows of test_callable_class_tool_summary_from_class_docstring now expect the parameter description the SDK reads. The tool description is the same on every version.

Neither needs a version check, so the range keeps 0.22.

Known limit: permanent approvals on 0.23 and 0.24

From 0.23, the SDK ties a tool approval to the agent object that owns the tool (openai/openai-agents-python#5144). The plugin runs a new copy of your agent on every run. So on 0.23 and 0.24, an approval given with always_approve=True doesn't carry over to a later run with the same agent and context: that run asks again. Resuming the paused run works as before.

#426 fixes this by running your agents without copies. Let's release the two together.

Is it Breaking?

No. The plugin's API and behavior don't change, and installs on 0.22 keep working.

Checklist

  1. Fixes [Feature Request] openai_agents: support openai-agents 0.23 and 0.24 #416

  2. How was this tested:

make sync, make lint and make test (Python 3.13) pass with openai-agents 0.22.0, 0.22.1, 0.22.2, 0.22.3, 0.23.1 and 0.24.0, each locked in a scratch copy (0.23.0 was never on PyPI). The recorded histories in test_openai_replay.py replay on all of them. make build, check_wheel.py and check_conventions.py pass with the lock. CI runs the locked 0.24.0.

  1. Any docs updates needed? No. The known limit above goes away with Breaking: openai_agents: run your agents, not copies, so permanent approvals carry over #426.

Widen the openai-agents range from >=0.22,<0.23 to >=0.22,<0.25 and
lock 0.24.0. The lock also moves pyjwt to 2.15.1, the floor that
openai-agents 0.23 sets. No plugin code changes.

Two tests pinned text that only openai-agents 0.22 gives:

- From 0.23 the SDK's default_tool_error_function returns a fixed
  message without error details, so the argument error tests check
  only that prefix. The parity test with a stock function_tool still
  checks the full text.
- From 0.24 function_schema reads an Args:-only docstring as parameter
  descriptions, so two callable-class rows expect what the SDK reads.

Lint and tests pass with 0.22.0 to 0.22.3, 0.23.1 and 0.24.0.

Fixes #416
@campoy
campoy marked this pull request as ready for review November 4, 2026 16:56
@campoy
campoy requested a review from a team as a code owner November 4, 2026 16:56
@campoy
campoy marked this pull request as draft November 4, 2026 16:59
Commits 037a4c4, 82d4a91, 01019ff and 89e1bb1 kept an always_approve
approval across runs on openai-agents 0.23+ by setting private Agents SDK
state on the plugin's agent copies. A follow-up PR instead stops copying
agents, so this PR goes back to the range change only.
@campoy
campoy marked this pull request as ready for review November 5, 2026 00:18
campoy added a commit that referenced this pull request Nov 5, 2026
…t-without-copy

Brings in #422's head d714998, which merged main at 3363a79. The only conflict was the ModelSummaryProvider import in test_openai_run_state.py: keep main's public import and drop the _convert_agent import this branch removed.
@campoy
campoy added this pull request to stack #459 November 10, 2026 00:02
@campoy
campoy merged commit 1e8fc15 into main Nov 10, 2026
29 checks passed
@campoy
campoy deleted the fix/openai-agents-0.24 branch November 10, 2026 01:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Feature Request] openai_agents: support openai-agents 0.23 and 0.24

2 participants