Skip to content

Conversation

@dependabot
Copy link
Contributor

@dependabot dependabot bot commented on behalf of github Dec 29, 2025

Bumps openai from 1.102.0 to 2.14.0.

Release notes

Sourced from openai's releases.

v2.14.0

2.14.0 (2025-12-19)

Full Changelog: v2.13.0...v2.14.0

Features

  • api: slugs for new audio models; make all model params accept strings (e517792)

Bug Fixes

  • use async_to_httpx_files in patch method (a6af9ee)

Chores

  • internal: add --fix argument to lint script (93107ef)

v2.13.0

2.13.0 (2025-12-16)

Full Changelog: v2.12.0...v2.13.0

Features

Chores

  • ci: add CI job to detect breaking changes with the Agents SDK (#1436) (237c91e)
  • internal: add missing files argument to base client (e6d6fd5)

v2.12.0

2.12.0 (2025-12-15)

Full Changelog: v2.11.0...v2.12.0

Features

  • api: api update (a95c4d0)
  • api: fix grader input list, add dated slugs for sora-2 (b2c389b)

v2.11.0

2.11.0 (2025-12-11)

Full Changelog: v2.10.0...v2.11.0

Features

... (truncated)

Changelog

Sourced from openai's changelog.

2.14.0 (2025-12-19)

Full Changelog: v2.13.0...v2.14.0

Features

  • api: slugs for new audio models; make all model params accept strings (e517792)

Bug Fixes

  • use async_to_httpx_files in patch method (a6af9ee)

Chores

  • internal: add --fix argument to lint script (93107ef)

2.13.0 (2025-12-16)

Full Changelog: v2.12.0...v2.13.0

Features

Chores

  • ci: add CI job to detect breaking changes with the Agents SDK (#1436) (237c91e)
  • internal: add missing files argument to base client (e6d6fd5)

2.12.0 (2025-12-15)

Full Changelog: v2.11.0...v2.12.0

Features

  • api: api update (a95c4d0)
  • api: fix grader input list, add dated slugs for sora-2 (b2c389b)

2.11.0 (2025-12-11)

Full Changelog: v2.10.0...v2.11.0

Features

2.10.0 (2025-12-10)

... (truncated)

Commits
  • d3e6321 release: 2.14.0
  • 4547f1a codegen metadata
  • a3c27a2 chore(internal): add --fix argument to lint script
  • 51c6885 feat(api): slugs for new audio models; make all model params accept strings
  • 62699d9 fix: use async_to_httpx_files in patch method
  • 20af6aa codegen metadata
  • f94256d release: 2.13.0
  • 9dc1d1a feat(api): gpt-image-1.5
  • 74b1e6f chore(ci): add CI job to detect breaking changes with the Agents SDK (#1436)
  • 3c016c6 chore(internal): add missing files argument to base client
  • Additional commits viewable in compare view

Dependabot compatibility score

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 merge will merge this PR after your CI passes on it
  • @dependabot squash and merge will squash and merge this PR after your CI passes on it
  • @dependabot cancel merge will cancel a previously requested merge and block automerging
  • @dependabot reopen will reopen this PR if it is closed
  • @dependabot close will close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually
  • @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)

@dependabot dependabot bot added dependencies Pull requests that update a dependency file python Pull requests that update Python code labels Dec 29, 2025
@claude
Copy link

claude bot commented Dec 29, 2025

Pull Request Review: OpenAI SDK Upgrade (v1.102.0 → v2.14.0)

⚠️ Critical Concerns - MAJOR VERSION UPGRADE

This PR upgrades the OpenAI Python SDK from v1.102.0 to v2.14.0, which is a major version upgrade. This type of upgrade typically introduces breaking changes that require careful testing and potentially code modifications.


Key Findings

1. Breaking Changes Risk - HIGH

Issue: The OpenAI Python SDK v2.0.0 introduced significant breaking changes that are not addressed in this PR.

Evidence:

  • This is a major version bump (v1 → v2)
  • Only 1 file changed (requirements/base.txt:51)
  • No code modifications made to adapt to v2 API changes
  • No migration code included

Major v2.0.0 Breaking Changes (based on typical OpenAI SDK v2 migrations):

  1. Client initialization changes: The SDK moved from module-level functions to client instances
  2. Response object structure changes: Response types are now stricter with Pydantic models
  3. Parameter name changes: Some parameters were renamed or restructured
  4. Error handling changes: Exception types and error responses changed
  5. Async client changes: Async methods now require explicit AsyncOpenAI client

2. Code Impact Analysis

Files using OpenAI SDK:

  • opencontractserver/llms/client.py:87 - Direct OpenAI import
    • Uses: from openai import OpenAI
    • Creates client: self.client = OpenAI(api_key=api_key)
    • Calls: self.client.chat.completions.create(**params)

Dependency Chain:

  • openai==2.14.0 is used by pydantic-ai==0.2.*
  • Pydantic-AI acts as abstraction layer for OpenAI SDK
  • Most OpenAI usage is indirect through Pydantic-AI agents

Critical: The code in opencontractserver/llms/client.py appears to already use v2-style API patterns (OpenAI() client, .chat.completions.create()), suggesting the codebase may have been written anticipating v2, or this is compatible syntax.

3. Pydantic-AI Compatibility

Good News:

  • pydantic-ai==0.2.* is the primary interface to OpenAI
  • Pydantic-AI abstracts away OpenAI SDK details
  • The upgrade may be primarily for Pydantic-AI's benefit

Concern:

  • Need to verify pydantic-ai 0.2.* officially supports openai>=2.0.0
  • Check if Pydantic-AI pins a specific OpenAI version range

4. Test Coverage

Observations:

  • Extensive test suite exists with VCR cassettes for API mocking
  • 93+ files reference pydantic-ai
  • Multiple integration tests exist
  • CI Status: Tests are currently running (linter, pytest checks pending)

Critical Next Step: Wait for CI to complete before merging

5. SimpleLLMClient Analysis

The direct OpenAI usage in opencontractserver/llms/client.py:

# Line 87-95: Client initialization
from openai import OpenAI
api_key = api_key or getattr(settings, "OPENAI_API_KEY", None)
self.client = OpenAI(api_key=api_key)

# Line 158: API call
response = self.client.chat.completions.create(**params)

# Line 161-177: Response handling
message = response.choices[0].message
usage = {
    "prompt_tokens": response.usage.prompt_tokens,
    "completion_tokens": response.usage.completion_tokens,
    "total_tokens": response.usage.total_tokens,
}

Assessment: This code already uses v2-compatible patterns, suggesting either:

  1. The codebase was written for v2 but pinned to v1 for stability
  2. The v1→v2 API is more compatible than typical major upgrades

Security Considerations

Low Risk: This is a dependency version bump from a trusted source (OpenAI)
No code changes: Reduces attack surface
⚠️ Untested compatibility: Could introduce runtime errors


Performance Considerations

⚠️ Unknown Impact: v2 may have different performance characteristics

  • Could affect token counting
  • May change rate limiting behavior
  • Potential async handling differences

Recommendations

🔴 BLOCK MERGE until:

  1. CI Tests Pass: Wait for all pytest and integration tests to complete successfully
  2. Manual Testing: Test key LLM features:
    • Document conversation WebSocket (StandaloneDocumentQueryConsumer)
    • Corpus chat functionality
    • Structured data extraction
    • Tool calling with approval flow
  3. Verify Pydantic-AI Compatibility: Confirm pydantic-ai==0.2.* officially supports openai>=2.0.0

📋 Post-Merge Actions:

  1. Update CHANGELOG.md: Add entry documenting the upgrade

    ### Changed
    - **OpenAI SDK upgraded** from v1.102.0 to v2.14.0 (`requirements/base.txt:51`)
      - Major version upgrade for compatibility with pydantic-ai framework
      - No API changes required (code already compatible with v2 patterns)
  2. Monitor Production: Watch for:

    • Unexpected API errors
    • Changes in response quality
    • Rate limiting issues
    • Token counting discrepancies
  3. Regression Testing: Run full backend test suite:

    # Parallel test execution (recommended)
    docker compose -f test.yml run django pytest -n 4 --dist loadscope

🟡 Nice to Have:

  1. Pin exact version: Consider changing openai==2.14.0 to openai~=2.14 for patch updates
  2. Document compatibility: Add comment in requirements explaining v2 requirement
  3. Add integration test: Create specific test for OpenAI SDK v2 features if not covered

Code Quality Assessment

Follows conventions: Dependabot PR follows standard format
Minimal change: Single-line change reduces risk
⚠️ No tests modified: Could indicate insufficient coverage
⚠️ No documentation: Should update CHANGELOG.md per CLAUDE.md guidelines


Final Verdict

🟡 CONDITIONAL APPROVAL - Approve only if:

  1. ✅ All CI checks pass (pytest, linter)
  2. ✅ No regression test failures
  3. ✅ Pydantic-AI compatibility verified

Rationale: The existing code appears v2-compatible, but this is a major upgrade that requires validation through the test suite. The extensive use of Pydantic-AI as an abstraction layer provides some protection, but direct usage in SimpleLLMClient needs verification.


Questions for Maintainers

  1. Was the codebase written anticipating OpenAI SDK v2?
  2. Has this upgrade been tested in a staging environment?
  3. Are there any known issues with pydantic-ai 0.2.* and openai 2.x?
  4. Should we consider a staged rollout or feature flag for this change?

Files Reviewed: 1
Critical Issues: 1 (major version upgrade risks)
Blockers: 1 (CI validation required)
Recommendations: 4

Bumps [openai](https://github.com/openai/openai-python) from 1.102.0 to 2.14.0.
- [Release notes](https://github.com/openai/openai-python/releases)
- [Changelog](https://github.com/openai/openai-python/blob/main/CHANGELOG.md)
- [Commits](openai/openai-python@v1.102.0...v2.14.0)

---
updated-dependencies:
- dependency-name: openai
  dependency-version: 2.14.0
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
@dependabot dependabot bot force-pushed the dependabot/pip/openai-2.14.0 branch from d17a88c to d796e07 Compare December 30, 2025 01:26
@claude
Copy link

claude bot commented Dec 30, 2025

Pull Request Review: OpenAI SDK Upgrade (1.102.0 → 2.14.0)

Overview

This PR bumps the OpenAI Python SDK from version 1.102.0 to 2.14.0 - a major version upgrade that spans from v1 to v2. This is a Dependabot-generated update.


Critical Concerns

🚨 MAJOR VERSION BREAKING CHANGES

This is a major version upgrade (v1.x → v2.x), which typically introduces breaking changes. Based on the OpenAI Python SDK changelog, v2.0.0 introduced significant breaking changes including:

  1. API signature changes for client initialization
  2. Response object structure changes
  3. Error handling changes
  4. Streaming API changes
  5. Type annotation updates

🔍 Impact Analysis

The codebase uses OpenAI SDK in the following locations:

  1. opencontractserver/llms/client.py (lines 87, 95, 158)

    • Direct usage of OpenAI client
    • Uses client.chat.completions.create() API
    • Accesses response attributes: response.choices[0].message, response.usage, response.model
  2. pydantic-ai==0.2.* dependency

    • This library uses OpenAI SDK internally
    • May have version constraints that are incompatible with OpenAI v2.x
    • Used extensively in opencontractserver/llms/agents/pydantic_ai_agents.py
  3. VCR cassettes in fixtures/vcr_cassettes/

    • 60+ test cassettes that record OpenAI API interactions
    • May need regeneration if request/response formats changed

Required Actions Before Merge

1. Verify Compatibility

Run the test suite to ensure no regressions:

# Run backend tests in parallel (recommended)
docker compose -f test.yml run django pytest -n 4 --dist loadscope

# Or run sequentially if you need detailed output
docker compose -f test.yml run django python manage.py test --keepdb

2. Check pydantic-ai Compatibility

Verify that pydantic-ai==0.2.* supports OpenAI SDK v2.x:

# Check if pydantic-ai has OpenAI version constraints
grep -r "openai" .venv/lib/python*/site-packages/pydantic_ai*/METADATA 2>/dev/null ||   python -c "import pydantic_ai; help(pydantic_ai)"

If pydantic-ai requires OpenAI v1.x, this upgrade will break the build.

3. Manual Testing Checklist

Test the following features that use OpenAI:

  • Document conversation WebSocket (uses pydantic-ai agents)
  • Corpus conversation WebSocket
  • Structured data extraction
  • LLM-based document analysis
  • Embedding generation (if using OpenAI embeddings)

4. VCR Cassette Regeneration

If tests pass but use outdated cassettes, consider regenerating them:

# Delete cassettes and re-record
rm -rf fixtures/vcr_cassettes/*.yaml
# Re-run tests to regenerate
docker compose -f test.yml run django pytest -n 4 --dist loadscope

Code Quality Assessment

Positive Aspects

  1. Minimal surface area: Only one file (requirements/base.txt) changed
  2. Automated update: Dependabot ensures reproducible changes
  3. Good abstraction: SimpleLLMClient wrapper isolates OpenAI SDK usage

⚠️ Potential Issues

  1. No test coverage for SimpleLLMClient: No dedicated unit tests found for opencontractserver/llms/client.py
  2. Missing async OpenAI client: Line 196 comment notes "TODO: Use native async OpenAI client" - v2.x may have improved async support
  3. Hardcoded model names: Uses gpt-4o-mini default - ensure this model exists in v2.x

Security Considerations

No Direct Security Issues

This is a library upgrade with no code changes, so no new vulnerabilities are introduced. However:

  1. API key handling: Verify that OpenAI(api_key=api_key) initialization still works correctly in v2.x
  2. Error messages: Ensure error messages don't leak sensitive information (OpenAI v2 may have different error formats)

Performance Considerations

Potential Improvements

OpenAI SDK v2.x may include:

  1. Better connection pooling
  2. Improved streaming support
  3. Reduced memory footprint
  4. Native async support (addresses TODO on line 196)

⚠️ Monitor After Deployment

  • Response times for LLM calls
  • Memory usage during concurrent requests
  • Error rates and retry behavior

Recommendations

🔴 BLOCK MERGE Until:

  1. ✅ All backend tests pass (pytest -n 4 --dist loadscope)
  2. ✅ Manual testing of LLM features completed
  3. ✅ Confirmed pydantic-ai compatibility with OpenAI v2.x

🟡 Follow-up Tasks:

  1. Add unit tests for SimpleLLMClient to prevent future breakage
  2. Consider implementing the async OpenAI client (line 196 TODO)
  3. Update CHANGELOG.md per repository guidelines:
## [Unreleased] - 2025-12-30

### Changed
- Upgraded OpenAI Python SDK from 1.102.0 to 2.14.0 (major version upgrade)

### Technical Details  
- Updated dependency in requirements/base.txt:51
- Verified compatibility with pydantic-ai 0.2.x
- All tests passing with new SDK version

🟢 After Verification:

If all tests pass and pydantic-ai is compatible, this upgrade is safe to merge and brings:

  • Latest OpenAI features (new audio models, gpt-image-1.5)
  • Bug fixes (async file handling in PATCH requests)
  • Better API consistency

Conclusion

This is a high-risk change due to the major version bump. Do not merge until all tests pass and compatibility is verified. Once validated, it's a beneficial upgrade that keeps dependencies current.

Next Steps:

  1. Run test suite
  2. Check pydantic-ai compatibility
  3. Report results here
  4. Update CHANGELOG.md if tests pass

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