Skip to content

refactor(openai-compatible): deprecate normalized chat option shims#12594

Open
giulio-leone wants to merge 1 commit intovercel:mainfrom
giulio-leone:codex/issue-12461-openai-compatible-options
Open

refactor(openai-compatible): deprecate normalized chat option shims#12594
giulio-leone wants to merge 1 commit intovercel:mainfrom
giulio-leone:codex/issue-12461-openai-compatible-options

Conversation

@giulio-leone
Copy link

@giulio-leone giulio-leone commented Feb 14, 2026

Summary

  • split OpenAI-compatible chat options into:
    • stable normalized options (user)
    • legacy normalized compatibility options (reasoningEffort, textVerbosity, strictJsonSchema)
  • keep legacy normalized options functional for backwards compatibility
  • emit deprecation warnings when legacy normalized options are used
  • continue passing provider-native options through providerOptions.<providerName>
  • update OpenAI-compatible provider docs to clarify preferred provider-native configuration

Why

Issue #12461 highlights that OpenAI-compatible is an abstraction layer, so hard-coding provider-specific option names in the normalized model options is brittle. This change keeps compatibility while moving toward a cleaner contract.

Details

  • Added openaiCompatibleLanguageModelChatLegacyOptions for deprecated normalized option shims.
  • Kept openaiCompatibleLanguageModelChatOptions focused on stable user.
  • Updated request-arg building to:
    • parse both stable and legacy options from openai-compatible, openaiCompatible, and provider-name keys
    • warn when legacy normalized options are used
    • filter both stable and legacy keys from passthrough request fields to avoid duplicates
  • Updated docs section for OpenAI-compatible chat options and deprecated legacy options.

Tests

  • pnpm --filter @ai-sdk/openai-compatible exec vitest --config vitest.node.config.js --run src/chat/openai-compatible-chat-language-model.test.ts
  • pnpm --filter @ai-sdk/openai-compatible exec eslint src/chat/openai-compatible-chat-options.ts src/chat/openai-compatible-chat-language-model.ts src/chat/openai-compatible-chat-language-model.test.ts
  • pnpm --filter @ai-sdk/openai-compatible type-check
  • pnpm exec prettier --check $(git diff --name-only)

Closes #12461

Attribution request

If this pull request is merged, I would be grateful if contributor credit could be included in the related changelog or release notes for implementing this fix (@g97iulio1609).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Consider how to handle provider options in OpenAI compatible provider

1 participant