Skip to content

fix(provider): guard textVerbosity injection for @ai-sdk/openai-compatible providers - #43915

Merged
neriousy merged 1 commit into
anomalyco:devfrom
joelstucki-taulia:fix/43911-textverbosity-openai-compatible-guard
Aug 21, 2026
Merged

fix(provider): guard textVerbosity injection for @ai-sdk/openai-compatible providers#43915
neriousy merged 1 commit into
anomalyco:devfrom
joelstucki-taulia:fix/43911-textverbosity-openai-compatible-guard

Conversation

@joelstucki-taulia

Copy link
Copy Markdown
Contributor

Issue for this PR

Closes #43911

Type of change

  • Bug fix
  • New feature
  • Refactor / code improvement
  • Documentation

What does this PR do?

options() in transform.ts sets textVerbosity: "low" for any gpt-5.x model as long as providerID !== "azure". That guard allows the default through for generic @ai-sdk/openai-compatible providers too (e.g. a LiteLLM proxy), which is wrong: verbosity is an OpenAI-specific parameter, and non-OpenAI backends behind such a proxy reject it outright.

Concretely, a gpt-5.6 model routed through a LiteLLM @ai-sdk/openai-compatible provider to AWS Bedrock ("Bedrock Mantle") fails every request with:

litellm.UnsupportedParamsError: bedrock_mantle does not support parameters: ['verbosity'], for model=openai.gpt-5.6-luna...

This is the same bug class already fixed for reasoningSummary in #21237 / #22352 (unconditional injection for gpt-5.x, guarded only against Azure instead of an explicit allowlist). textVerbosity never got the equivalent fix.

The fix switches the check from a denylist (providerID !== "azure") to an allowlist of providers known to actually implement verbosity: @ai-sdk/openai and @ai-sdk/amazon-bedrock/mantle. Everything else (including @ai-sdk/openai-compatible, @ai-sdk/azure, @ai-sdk/github-copilot) no longer receives textVerbosity, matching how reasoningSummary/include are already scoped a few lines above in the same function.

How did you verify your code works?

  • bun test test/provider/transform.test.ts — 411 pass, 0 fail (added an explicit expect(result.textVerbosity).toBeUndefined() assertion to the existing openai-compatible gpt-5 models omit Responses-only reasoningSummary test).
  • bun turbo typecheck — 30/30 packages pass.
  • Reproduced the original error against a LiteLLM proxy fronting Bedrock Mantle; after this change textVerbosity is correctly omitted from the request and the call succeeds.

Screenshots / recordings

N/A — no UI change.

Checklist

  • I have tested my changes locally
  • I have not included unrelated changes in this PR

…tible providers

Only enable the gpt-5.x textVerbosity default for integrations known to
implement OpenAI's verbosity parameter (@ai-sdk/openai and
@ai-sdk/amazon-bedrock/mantle). Previously the guard excluded only
Azure, so generic @ai-sdk/openai-compatible providers (e.g. LiteLLM
proxies) received textVerbosity as well. When such a proxy routes to
AWS Bedrock behind the scenes, Bedrock rejects the resulting verbosity
parameter with litellm.UnsupportedParamsError, breaking every request
(including configured fallbacks) to any gpt-5.x model on that provider.

This mirrors the existing reasoningSummary guard pattern fixed in
anomalyco#21237 / anomalyco#22352, which textVerbosity never received.

Fixes anomalyco#43911
@neriousy

Copy link
Copy Markdown
Contributor

Thanks for the PR!

@neriousy
neriousy merged commit 3a4c253 into anomalyco:dev Aug 21, 2026
10 checks passed
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.

textVerbosity injected for gpt-5.x on @ai-sdk/openai-compatible providers, breaks Bedrock Mantle via LiteLLM gateway

2 participants