Skip to content

feat(openai): deprecate Chat Completions default ahead of 1.4.0 - #3517

Merged
vvlrff merged 5 commits into
mainfrom
deprecate-openai-chat-default
Oct 27, 2026
Merged

vvlrff merged 5 commits into
mainfrom
deprecate-openai-chat-default

Conversation

@Lancetnik

@Lancetnik Lancetnik commented Oct 27, 2026 •

Copy link
Copy Markdown
Member

Why are these changes needed?

OpenAIConfig currently selects Chat Completions, while Responses is the intended OpenAI default. Rebinding the name immediately would change existing applications' endpoints and accepted parameters without a migration period.

Expose the current implementation as OpenAICompletionsConfig and keep OpenAIConfig as a deprecated compatibility subclass until 1.4.0. It preserves the constructor, copied config type, Chat Completions parameters, Files API support, and media acceptance. The class is marked deprecated for type checkers; create() emits a DeprecationWarning directing users to OpenAICompletionsConfig or OpenAIResponsesConfig. Construction and copying do not warn, consistent with ADR 0025.

In 1.4.0, the deprecated Chat Completions binding will be removed and OpenAIConfig will become an alias for OpenAIResponsesConfig. This PR records that release change in ADR 0026 and the model configuration guide; it does not switch existing callers to Responses yet. The guide recommends explicit configs during the transition and explains that API-specific options need translation when migrating.

Validation on Python 3.14.3:

  • just test --ignore=test/providers -k openai: 410 passed, 28 skipped, 6282 deselected. Includes mocked HTTP requests through Agent.ask() for both public import paths, warning timing and caller location, copy behavior, media acceptance, and existing OpenAI provider tests. Live provider tests were excluded.
  • All required commit hooks passed, including repository-wide Ruff lint/format checks, the configured mypy suite, typo/spelling checks, license headers, and secret detection.
  • Targeted mypy: no issues in ag2/config/openai/{config,files,__init__}.py and ag2/config/input_acceptance.py.
  • Ruff lint and format checks passed for the changed Python files; codespell passed for the new ADR and tests.
  • Verified the OpenAICompletionsConfig missing-dependency fallback recommends ag2[openai].
  • Parsed all 46 Python examples in the updated model configuration guide. Full documentation build was not run.
  • git diff --check passed.

Related issue number

No linked issue.

Checks

AI assistance

Codex assisted with implementation, tests, documentation, and this description. The diff and description were reviewed against the requested behavior, and the validation above was run before submission.

  • I understand the changes in this PR and can explain them in my own words.
  • I have verified that the PR description accurately reflects the actual diff.
  • If AI assistance was used, I reviewed, tested, and validated the generated code/text before submitting.

@Lancetnik Lancetnik self-assigned this Oct 27, 2026
@Lancetnik
Lancetnik requested a review from marklysze as a code owner October 27, 2026 17:26
@github-actions github-actions Bot added area:docs Documentation (website/) area:tools Tool system, builtin tools, subagents (ag2/tools) area:providers LLM provider clients and mappers (ag2/config) labels Oct 27, 2026
@Lancetnik
Lancetnik requested a review from vvlrff October 27, 2026 17:34
@codecov

codecov Bot commented Oct 27, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 93.33333% with 1 line in your changes missing coverage. Please review.

Files with missing lines Patch % Lines
ag2/config/__init__.py 0.00% 1 Missing ⚠️
Files with missing lines Coverage Δ
ag2/config/input_acceptance.py 96.15% <100.00%> (+0.15%) ⬆️
ag2/config/openai/__init__.py 100.00% <100.00%> (ø)
ag2/config/openai/config.py 99.10% <100.00%> (+0.02%) ⬆️
ag2/config/openai/files.py 100.00% <100.00%> (ø)
ag2/live/cascade.py 83.51% <ø> (ø)
ag2/tools/builtin/image_generation.py 93.18% <ø> (ø)
ag2/config/__init__.py 47.05% <0.00%> (-0.95%) ⬇️
🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@vvlrff
vvlrff enabled auto-merge October 27, 2026 20:16
@vvlrff
vvlrff added this pull request to the merge queue Oct 27, 2026
Merged via the queue into main with commit fa4e0fb Oct 27, 2026
23 of 24 checks passed
@vvlrff
vvlrff deleted the deprecate-openai-chat-default branch October 27, 2026 20:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area:docs Documentation (website/) area:providers LLM provider clients and mappers (ag2/config) area:tools Tool system, builtin tools, subagents (ag2/tools)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants