Skip to content

fix(provider): scope gpt-5 reasoningEffort to native providers only#31465

Open
liloi wants to merge 2 commits into
anomalyco:devfrom
liloi:fix/scope-gpt5-reasoning-effort-to-native-providers
Open

fix(provider): scope gpt-5 reasoningEffort to native providers only#31465
liloi wants to merge 2 commits into
anomalyco:devfrom
liloi:fix/scope-gpt5-reasoning-effort-to-native-providers

Conversation

@liloi

@liloi liloi commented Jun 9, 2026

Copy link
Copy Markdown

Issue for this PR

Closes #31466

Type of change

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

What does this PR do?

reasoningEffort = "medium" is set unconditionally at L1145 for all gpt-5 models, regardless of provider type. When using @ai-sdk/openai-compatible to connect to third-party gateways (e.g. Sophon), the gateway may not support this parameter and rejects the request.

The fix moves the reasoningEffort assignment inside the existing provider allowlist condition (which already guards reasoningSummary), so it only applies to native providers that actually support it: @ai-sdk/openai, @ai-sdk/azure, @ai-sdk/github-copilot, and @ai-sdk/amazon-bedrock/mantle.

How did you verify your code works?

Confirmed that after the change, requests via @ai-sdk/openai-compatible to a Sophon gateway no longer include reasoningEffort and succeed. Native OpenAI provider behavior is unchanged.

Screenshots / recordings

N/A (backend-only change)

Checklist

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

The `reasoningEffort = "medium"` assignment was unconditionally applied
to all providers when the model ID matched gpt-5. This caused requests
to fail on third-party gateways (e.g. Sophon) accessed via
@ai-sdk/openai-compatible, which may not support the reasoningEffort
parameter.

Move the assignment inside the existing native provider allowlist guard
so only @ai-sdk/openai, @ai-sdk/azure, @ai-sdk/github-copilot, and
@ai-sdk/amazon-bedrock/mantle receive it.
@github-actions github-actions Bot added needs:compliance This means the issue will auto-close after 2 hours. needs:issue labels Jun 9, 2026
@github-actions

github-actions Bot commented Jun 9, 2026

Copy link
Copy Markdown
Contributor

Thanks for your contribution!

This PR doesn't have a linked issue. All PRs must reference an existing issue.

Please:

  1. Open an issue describing the bug/feature (if one doesn't exist)
  2. Add Fixes #<number> or Closes #<number> to this PR description

See CONTRIBUTING.md for details.

@github-actions

github-actions Bot commented Jun 9, 2026

Copy link
Copy Markdown
Contributor

The following comment was made by an LLM, it may be inaccurate:

Potential Duplicate Found:

Why it may be related:
Both PRs deal with native GPT-5 parameters (reasoningSummary vs reasoningEffort) being incorrectly forwarded through the openai-compatible adapter to third-party gateways. The current PR appears to be a related fix in the same area, possibly addressing a similar issue that was partially fixed in #14783.

@github-actions github-actions Bot removed needs:issue needs:compliance This means the issue will auto-close after 2 hours. labels Jun 9, 2026
@github-actions

github-actions Bot commented Jun 9, 2026

Copy link
Copy Markdown
Contributor

Thanks for updating your PR! It now meets our contributing guidelines. 👍

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.

gpt-5 reasoningEffort is unconditionally set for all providers including openai-compatible

1 participant