Skip to content

Chore(deps): update openai requirement from <3,>=2.38.0 to >=2.41.0,<3 - #1914

Merged
JSv4 merged 4 commits into
mainfrom
dependabot/pip/openai-gte-2.41.0-and-lt-3
Jun 4, 2026
Merged

Chore(deps): update openai requirement from <3,>=2.38.0 to >=2.41.0,<3#1914
JSv4 merged 4 commits into
mainfrom
dependabot/pip/openai-gte-2.41.0-and-lt-3

Conversation

@dependabot

@dependabot dependabot Bot commented on behalf of github Jun 4, 2026

Copy link
Copy Markdown
Contributor

Updates the requirements on openai to permit the latest version.

Release notes

Sourced from openai's releases.

v2.41.0

2.41.0 (2026-06-03)

Full Changelog: v2.40.0...v2.41.0

Features

  • api: responses.moderation and chat_completions.moderation (87e46c2)
Changelog

Sourced from openai's changelog.

2.41.0 (2026-06-03)

Full Changelog: v2.40.0...v2.41.0

Features

  • api: responses.moderation and chat_completions.moderation (87e46c2)

2.40.0 (2026-06-01)

Full Changelog: v2.39.0...v2.40.0

Features

  • api: Add Amazon Bedrock Responses support

Bug Fixes

  • api: allow setting bedrock api keys on the client directly (4d5bfde)

2.39.0 (2026-06-01)

Full Changelog: v2.38.0...v2.39.0

Features

  • api: workload identity in audit logs, additional_tools item in responses, fix ActionSearch.query to be optional. (ab60d7a)

2.38.0 (2026-05-21)

Full Changelog: v2.37.0...v2.38.0

Features

  • api: api update (33d1d01)
  • api: manual updates (a21700a)
  • api: update OpenAPI spec or Stainless config (00265c5)

Chores

  • api: docs updates (ee10152)
  • check release PR custom code sync (2638779)
  • remove release automation trigger (bd6eea5)
  • trigger release automation (f62d082)

2.37.0 (2026-05-13)

Full Changelog: v2.36.0...v2.37.0

Features

... (truncated)

Commits
  • 2d955a1 Merge pull request #3359 from openai/release-please--branches--main--changes-...
  • 519cd02 release: 2.41.0
  • 87e46c2 feat(api): responses.moderation and chat_completions.moderation
  • a28a3f6 Merge pull request #3352 from openai/release-please--branches--main--changes-...
  • db6ccaf Update CHANGELOG.md
  • 2264f70 release: 2.40.0
  • 4d5bfde fix(api): allow setting bedrock api keys on the client directly
  • ccef143 Merge pull request #3326 from openai/codex/bedrock-responses-review
  • a50ff0a Fix Bedrock with_options overrides
  • fdf4901 codegen metadata
  • Additional commits viewable in compare view

Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting @dependabot rebase.


Dependabot commands and options

You can trigger Dependabot actions by commenting on this PR:

  • @dependabot rebase will rebase this PR
  • @dependabot recreate will recreate this PR, overwriting any edits that have been made to it
  • @dependabot show <dependency name> ignore conditions will show all of the ignore conditions of the specified dependency
  • @dependabot ignore this major version will close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself)
  • @dependabot ignore this minor version will close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself)
  • @dependabot ignore this dependency will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself)

Updates the requirements on [openai](https://github.com/openai/openai-python) to permit the latest version.
- [Release notes](https://github.com/openai/openai-python/releases)
- [Changelog](https://github.com/openai/openai-python/blob/main/CHANGELOG.md)
- [Commits](openai/openai-python@v2.38.0...v2.41.0)

---
updated-dependencies:
- dependency-name: openai
  dependency-version: 2.41.0
  dependency-type: direct:production
...

Signed-off-by: dependabot[bot] <support@github.com>
@dependabot dependabot Bot added dependencies Pull requests that update a dependency file python Pull requests that update Python code labels Jun 4, 2026
@claude

claude Bot commented Jun 4, 2026

Copy link
Copy Markdown

Code Review

Overview

This is a Dependabot-generated dependency bump for the openai Python SDK, raising the minimum required version from >=2.38.0 to >=2.41.0 while keeping the existing <3 upper bound. A single line changes in requirements/base.txt.


Changes Between 2.38.0 and 2.41.0

Version Key Changes
2.41.0 New responses.moderation and chat_completions.moderation API endpoints
2.40.0 Amazon Bedrock Responses support; fix for setting Bedrock API keys directly on the client
2.39.0 Workload identity in audit logs; additional_tools item in responses; ActionSearch.query made optional

All changes are additive — no breaking changes are listed in any of the three release changelogs.


Assessment

Risk: Low

  • The bump stays within the same major version (<3), which the project already pins as the upper bound.
  • All new features (Bedrock, moderation endpoints) are opt-in additions and do not affect existing call sites.
  • The existing comment in requirements/base.txt (pydantic-ai 1.x requires >=2.11.0) remains valid — 2.41.0 is well above that floor.
  • No test changes are needed; this is a pure constraint update with no new code paths exercised by the project itself.

No issues found. Safe to merge.


Minor Note

The inline comment in requirements/base.txt is preserved correctly. Nothing further required.

JSv4 added 3 commits June 3, 2026 22:24
aiohttp 3.14.0 removed aiohttp.streams.AsyncStreamReaderMixin, which
vcrpy==8.1.1's aiohttp stub imports at module load. A fresh CI install
picked up 3.14.0 and every pytest collection aborted with
AttributeError. Pin below 3.14 until vcrpy supports the new aiohttp API.
@claude

claude Bot commented Jun 4, 2026

Copy link
Copy Markdown

Code Review

Overview

This PR bundles two distinct changes:

  1. Dependabot bump: openai floor raised from >=2.38.0 to >=2.41.0 (still <3).
  2. Manual fix (3 commits by @JSv4): caps aiohttp<3.14 to unblock CI where vcrpy==8.1.1 fails to import against aiohttp 3.14's removed AsyncStreamReaderMixin, and adds the matching changelog fragment.

What looks good

  • openai bump is safe. Releases 2.39–2.41 are purely additive (Bedrock Responses support, moderation endpoints on responses/chat_completions, audit-log fields). No breaking changes detected in the changelog; raising the floor is appropriate.
  • Changelog fragment is well-written. changelog.d/1914-aiohttp.fixed.md follows the project's <slug>.<type>.md convention, explains the root cause (AsyncStreamReaderMixin removal), names the guilty dependency (vcrpy==8.1.1), and includes a clear exit condition ("lift this cap alongside a vcrpy bump"). That's exactly what the CLAUDE.md asks for.
  • Inline comment in requirements/base.txt mirrors the fragment and gives future maintainers enough context to act without hunting through history.

Concerns

1. Rebasing will silently drop the aiohttp fix

dependabot[bot] still owns this branch (dependabot/pip/openai-gte-2.41.0-and-lt-3). If anyone comments @dependabot rebase — or Dependabot auto-rebases on a new openai release — it will force-push and erase the three manually-added commits (aiohttp cap + changelog fragment), breaking CI again with no trace of why.

Recommendation: merge this quickly as-is, or cherry-pick the aiohttp cap + fragment to main via a separate PR first so it can't be lost.

2. aiohttp<3.14 is a hard upper cap with no tracking issue

Pinning below a released version is a time-bomb: any downstream dependency that starts requiring >=3.14 will produce an unresolvable conflict. There's no linked issue to force follow-up.

Recommendation: open a follow-up issue (e.g. "Lift aiohttp<3.14 cap when vcrpy supports aiohttp 3.14") and reference it in both the requirements comment and the changelog fragment. Something like:

aiohttp>=3.13,<3.14  # ... (see issue #XXXX)

3. vcrpy==8.1.1 is itself hard-pinned and not surfaced here

The root cause is vcrpy==8.1.1 using a removed API — the aiohttp cap is a workaround, not a fix. The PR doesn't touch vcrpy or explain why it can't be bumped. If there's a blocking reason (e.g. cassette format incompatibility), that deserves a comment in requirements/ next to the vcrpy pin so the two constraints are visibly linked.

4. No changelog fragment for the openai bump itself

The CLAUDE.md calls for fragments when new API features are unlocked. The 2.41 release adds responses.moderation and chat_completions.moderation — if OpenContracts exposes those surfaces, a changed or added fragment is appropriate. If the project doesn't use them yet, no fragment is needed, but that's worth a quick check.


Minor

  • The aiohttp comment in requirements/base.txt is long but informative — the length is justified here given the non-obvious constraint.
  • No test changes accompany this PR. That's expected for a pure dependency bump, but CI should confirm vcrpy cassettes still replay correctly after the openai floor raise (new response shapes in 2.39–2.41 could invalidate cassettes that replay Responses API calls).

Verdict

The changes are correct and well-documented. The main risk is that the manual commits are sitting on a Dependabot-owned branch and could be silently dropped on a rebase. Merge promptly and open a tracking issue for the vcrpy upgrade.

@JSv4

JSv4 commented Jun 4, 2026

Copy link
Copy Markdown
Collaborator

@dependabot rebase

@dependabot @github

dependabot Bot commented on behalf of github Jun 4, 2026

Copy link
Copy Markdown
Contributor Author

Looks like this PR has been edited by someone other than Dependabot. That means Dependabot can't rebase it - sorry!

If you're happy for Dependabot to recreate it from scratch, overwriting any edits, you can request @dependabot recreate.

@JSv4
JSv4 merged commit cf603c5 into main Jun 4, 2026
11 checks passed
@JSv4
JSv4 deleted the dependabot/pip/openai-gte-2.41.0-and-lt-3 branch June 4, 2026 05:21
pull Bot pushed a commit to osamakaram/OpenContracts that referenced this pull request Jun 7, 2026
aiohttp is an unpinned transitive dep (via llama-index-core); Open-Source-Legal#1914 capped
it <3.14 because aiohttp 3.14 removed aiohttp.streams.AsyncStreamReaderMixin,
which vcrpy 8.1.1's aiohttp stub (vcr/stubs/aiohttp_stubs.py) subclasses when
vcrpy lazily loads it on cassette entry — making every VCR-using test raise
AttributeError. vcrpy 8.1.1 is the latest release and has no fix released yet
(kevin1024/vcrpy#995; unreleased PR Open-Source-Legal#996), so the issue's "bump vcrpy" step is
not yet possible.

Since this codebase only records/replays httpx (LLM) cassettes, the aiohttp
MockStream is never instantiated. Add a small, idempotent import-time shim,
ensure_aiohttp_vcr_compat(), that restores the removed symbol as an empty
mixin so cassette entry works under aiohttp >=3.14; it is a no-op under
aiohttp <3.14 (the real mixin is left untouched). The shim is applied from
the root conftest.py (before any test runs) and from maybe_vcr_cassette()
(for the non-pytest E2E harness). Remove the cap so aiohttp floats back to
3.14+.

Verified against aiohttp 3.14.0 + vcrpy 8.1.1 (bug reproduced without the
shim; cassette entry succeeds with it) and aiohttp 3.13.5 (no-op path).
Drop the shim and bump vcrpy once a release ships the vcrpy#996 fix.

Closes Open-Source-Legal#1920
JSv4 added a commit that referenced this pull request Jul 24, 2026
aiohttp 3.14 removed `aiohttp.streams.AsyncStreamReaderMixin`, which
vcrpy 8.1.1's `vcr/stubs/aiohttp_stubs.py` subclassed at import time.
vcrpy loads that stub lazily when a cassette is entered, so every VCR
cassette entry raised AttributeError (issue #1920). The workaround was
`ensure_aiohttp_vcr_compat()`, which re-injected the removed name as an
empty class.

vcrpy 8.2.0 fixed the stub upstream (kevin1024/vcrpy#996): `MockStream`
now inherits only from `asyncio.StreamReader` and handles the 3.14
`stream_writer` argument itself. The pin has been at 8.2.1 or later since
then, so the shim has been redundant — and not merely inert. Under
aiohttp 3.14 the `hasattr` guard fell through, so conftest import was
still writing a fake `AsyncStreamReaderMixin` into the real
`aiohttp.streams` namespace on every test run.

Verified in two environments, in both cases entering a cassette with no
shim applied and confirming `MockStream.__bases__ ==
(asyncio.StreamReader,)`:

  - the local django image: vcrpy 8.2.1 + aiohttp 3.14.1 (the exact
    pre-bump pairing the issue asks about)
  - a clean venv: vcrpy 8.3.0 + aiohttp 3.14.1 (the current pin)

Removed:
  - `ensure_aiohttp_vcr_compat()` in
    `opencontractserver/utils/vcr_replay.py` and its call in
    `maybe_vcr_cassette()`
  - the import and module-level call in `conftest.py`
  - `EnsureAiohttpVcrCompatTests` in
    `opencontractserver/tests/test_vcr_replay.py`
  - the `requirements/local.txt` comment, which still described vcrpy
    8.1.1 as the pinned version and #996 as unreleased; replaced with a
    short note on why the floor is 8.2.0

The `aiohttp>=3.13,<3.14` cap this was paired with (issue #1914) was
already lifted on main.

`EnsureAiohttpVcrCompatTests` is replaced by `VcrCassetteEntryTests`,
which keeps the part of the guard that survives the shim: entering a
cassette forces the lazy import of `vcr/stubs/aiohttp_stubs.py`, so the
test fails if a future vcrpy/aiohttp pairing reintroduces an import-time
incompatibility.

72 tests pass across `test_vcr_replay.py`, `test_structured_response_simple.py`,
`test_structured_response_api.py`, and `test_individual_extract_tasks.py`.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

dependencies Pull requests that update a dependency file python Pull requests that update Python code

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant