Bump openai to 2.52.0 and openai-agents to 0.19.1 - #288
Merged
Merged
Conversation
pyproject.toml: openai 1.107.0 -> 2.52.0, openai-agents 0.2.11 -> 0.19.1. openai 2.7.2 replaced the discriminated-union attribute cache in openai/_models.py with a WeakKeyDictionary, which is what Python 3.14 requires now that typing.Union instances carry no __dict__. Also swap griffe==1.7.3 for griffelib==2.1.0: openai-agents 0.19.1 depends on griffelib, which supplies the same `griffe` import name. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Copilot-Session: dadec5f9-3bf8-449c-84d6-db45be19bb6a
anticomputer
requested review from
JarLob,
Kwstubbs,
kevinbackhouse,
p- and
sylwia-budzynska
as code owners
July 31, 2026 18:21
Contributor
There was a problem hiding this comment.
Pull request overview
Updates the project’s pinned OpenAI SDK dependencies to versions compatible with Python 3.14 streaming on the Responses API, addressing the typing.Union discriminated-union metadata caching issue described in the PR.
Changes:
- Bump
openaifrom1.107.0to2.52.0. - Bump
openai-agentsfrom0.2.11to0.19.1. - Replace the
griffepin withgriffelibto align withopenai-agents’ newer dependency chain.
Show a summary per file
| File | Description |
|---|---|
| pyproject.toml | Updates pinned dependency versions for openai/openai-agents and swaps griffe → griffelib to match the upgraded agent SDK dependency set. |
Review details
Tip
Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
- Files reviewed: 1/1 changed files
- Comments generated: 0
- Review effort level: Lite
p-
approved these changes
Aug 3, 2026
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.
Problem
Under Python 3.14 every run that streams from the Responses API dies before the first task completes:
openai1.107.0 memoises discriminated-union metadata by assigning an attribute onto thetyping.Unionobject itself. Python 3.14 madetyping.Unioninstances carry no__dict__, so the assignment raises. It fires fromagents/models/openai_responses.pyon the streaming path, meaning the agent is unusable on 3.14 with anyapi_type: responsesmodel.Upstream fixed this in
openai2.7.2 (openai/openai-python@15a7ec8, #2704) by moving the cache to aweakref.WeakKeyDictionary. The pinnedopenai-agents==0.2.11requiresopenai<2, so both had to move together.Change
pyproject.tomlonly:openaiopenai-agentsgriffegriffelibopenai-agents0.19.1 depends ongriffelib, which ships the samegriffeimport name thatagents/function_schema.pyuses. Since this file pins transitively, the stalegriffepin is replaced rather than left to dangle — leaving both installed lets whichever is uninstalled last clobber the sharedgriffe/directory.No source changes were needed;
pip checkreports no broken requirements and no other pin in the file drifted.Validation
pytest: 556 passed, 2 skipped — unchanged from before the bump.hatch fmt --linter --check: clean.Live smoke run against CAPI on Python 3.14.5, one task per backend, all four returning normally where the first previously aborted with the
AttributeError:general_tasksgpt-5.4openai_agentsresponseshunt_claudeclaude-opus-5anthropic_sdkmessageshunt_geminigemini-3.6-flashopenai_agentschat_completionsadjudicationgrok-4.5openai_agentsresponses