chore(deps): declare OpenAI 1.66.2 as supported floor - #66
Open
isaacbmiller wants to merge 1 commit into
Open
Conversation
Issue / repro: DSPy declares openai>=0.28.1 even though shipped runtime paths use the v1 OpenAI client, fine_tuning.jobs and files resources, typed API errors, and Responses reasoning summaries. OpenAI 0.28.1 provides none of those v1 entry points. Root cause: The 0.x-compatible lower bound survived after DSPy adopted v1-only fine-tuning and Responses APIs. The lock hid the mismatch by resolving OpenAI 1.75 or 1.88 in development and CI. Why this proves the root cause: An isolated 0.28.1 probe lacks OpenAI, NotFoundError, fine_tuning, and files. The lowest valid LiteLLM graph resolves OpenAI 1.66.1, which has the v1 APIs but lacks the corrected ResponseReasoningItem schema. The same graph at 1.66.2 verifies the runtime resources, error classes, and a reasoning summary. Upstream released 1.66.2 only 75 minutes after 1.66.1 specifically to correct the Responses reasoning output type. Why this boundary and fix are minimal: The change updates only the source requirement and its mirrored lock metadata. It does not change an OpenAI package version, hash, transitive dependency, runtime branch, or compatibility fallback. The existing 1.75 and 1.88 lock selections remain intact. Context: This is a declared-contract correction, not the separate OpenAI 2.x Dependabot upgrade. Versions pinned at or below 1.66.1 will now fail resolution intentionally because they do not cover DSPy's complete shipped OpenAI surface. Actual fix: Raise the declared and locked project requirement from openai>=0.28.1 to openai>=1.66.2. Verification: Exact minimum probe: LiteLLM 1.64.1 plus OpenAI 1.66.2 passed resource, error, and Responses reasoning checks. Below-floor control: OpenAI 1.66.1 lacked ResponseReasoningItem as expected. uv sync --all-extras --frozen uv run --frozen pytest --deno -q tests/clients uv run --frozen pytest --deno -q tests/adapters/test_json_adapter.py -k responses uv build --out-dir /tmp/dspy-openai-floor-dist uv run --frozen pre-commit run --all-files Wheel metadata: Requires-Dist: openai>=1.66.2 Scope audit: A uv lock dry run requests only the pre-existing unrelated DSPy root-version update from 3.2.1 to 3.3.0b1. That line is intentionally excluded from this commit.
isaacbmiller
marked this pull request as ready for review
July 12, 2026 19:23
Greptile SummaryThis PR updates DSPy's declared OpenAI dependency floor.
Confidence Score: 5/5This looks safe to merge. No blocking issues were found in the changed code. The lock already resolves OpenAI to versions above the new floor, and the project Python range remains compatible with the resolved OpenAI packages. No files need attention.
What T-Rex did
Important Files Changed
Reviews (1): Last reviewed commit: "chore(deps): declare OpenAI 1.66.2 as su..." | Re-trigger Greptile |
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
DSPy currently claims OpenAI 0.28.1 is supported, but shipped code already depends on the v1 SDK and on the corrected Responses reasoning schema. This PR makes the package contract truthful:
The same requirement is mirrored in
uv.lock. No OpenAI package, hash, transitive dependency, or runtime code changes.Review dossier
1. Issue / repro
The declared floor and the shipped API surface disagree.
DSPy declares:
"openai>=0.28.1"But shipped runtime paths use v1-only entry points:
DSPy also processes Responses reasoning summaries:
An isolated OpenAI 0.28.1 probe confirms that
OpenAI,fine_tuning, andfilesare all absent. The current metadata therefore advertises an SDK generation the shipped code cannot execute.2. Why this is the root cause
The
>=0.28.1floor is legacy metadata from the period when DSPy deliberately supported both OpenAI 0.x and 1.x. It remained after DSPy adopted:The lockfile masks the stale declaration because development and CI already resolve OpenAI 1.75 or 1.88.
3. How we know 1.66.2 is the correct boundary
This does not rest on one test.
OpenAI,fine_tuning,files, or v1 error classesResponseReasoningItemschema is absentThe upstream release history explains the patch boundary:
So 1.66.2 is the first corrected release for the complete OpenAI surface DSPy ships—not simply the version that makes a fixture import.
4. Why this fix is concise
The entire PR is two metadata substitutions across two files:
There is:
5. Context needed to validate it
This is a lower-bound correction, not the separate Dependabot upgrade to OpenAI 2.x.
The practical compatibility cost is intentionally narrow: downstream environments pinned at or below 1.66.1 will now fail resolution. Normal DSPy installs already resolve at least 1.66.1 through LiteLLM, and 1.66.2 followed 1.66.1 by 75 minutes.
A full
uv lock --checkalso detects a pre-existing unrelated mismatch in DSPy's own recorded version (3.2.1vs3.3.0b1). This PR deliberately excludes that line to preserve the two-line scope.6. What the fix does
The wheel now publishes:
That prevents installers from selecting SDKs that cannot represent the full OpenAI behavior DSPy ships, while preserving the exact packages used by current development and CI.
Verification
ResponseReasoningItemas expected.OpenAI,fine_tuning,files, and v1 errors were absent.uv sync --all-extras --frozen— passed without changing the lock.uv run --frozen pytest --deno -q tests/clients— 133 passed, 21 skipped.uv run --frozen pytest --deno -q tests/adapters/test_json_adapter.py -k responses— 1 passed.uv build --out-dir /tmp/dspy-openai-floor-dist— wheel and sdist built.Requires-Dist: openai>=1.66.2.uv run --frozen pre-commit run --all-files— passed.git diff --check cmpnd/main..HEAD— clean.Scope
One commit. Two files. Two changed metadata lines.