Skip to content

fix(opencode): add Gemini 2.5 thinkingConfig variants for SAP AI providers#14958

Open
jerome-benoit wants to merge 5 commits intoanomalyco:devfrom
jerome-benoit:fix/sap-ai-gemini-thinking-variants
Open

fix(opencode): add Gemini 2.5 thinkingConfig variants for SAP AI providers#14958
jerome-benoit wants to merge 5 commits intoanomalyco:devfrom
jerome-benoit:fix/sap-ai-gemini-thinking-variants

Conversation

@jerome-benoit
Copy link
Contributor

@jerome-benoit jerome-benoit commented Feb 24, 2026

Issue for this PR

Closes #14957

Type of change

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

What does this PR do?

Fixes Gemini 2.5 reasoning variants for SAP AI provider (@jerome-benoit/sap-ai-provider-v2).

Previously, Gemini 2.5 models via SAP AI Core fell through to the generic reasoningEffort fallback, which does not work for Gemini. Now they correctly receive thinkingConfig with thinkingBudget values matching the native @ai-sdk/google provider.

Also restricts reasoningEffort to GPT and o-series models only (not all SAP AI models).

How did you verify your code works?

  • Added unit tests for SAP AI provider variants (Claude, Gemini 2.5, Gemini 2.0, GPT, o-series, Sonar, Mistral)
  • All 109 tests pass
  • TypeScript compilation passes

Screenshots / recordings

N/A - no UI changes

Checklist

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

Copilot AI review requested due to automatic review settings February 24, 2026 21:58
@github-actions github-actions bot added needs:compliance This means the issue will auto-close after 2 hours. contributor labels Feb 24, 2026
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR adds support for Gemini 2.5 models' reasoning capabilities when accessed through SAP AI providers (@mymediset/sap-ai-provider and @jerome-benoit/sap-ai-provider-v2). Previously, these models fell through to a generic reasoningEffort fallback which doesn't work for Gemini models, which require the thinkingConfig format instead.

Changes:

  • Added Gemini 2.5 detection logic for SAP AI providers that returns thinkingConfig with thinkingBudget values matching the native @ai-sdk/google provider
  • Enables proper reasoning support for Gemini 2.5 Pro/Flash models when proxied through SAP AI Core

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@jerome-benoit jerome-benoit force-pushed the fix/sap-ai-gemini-thinking-variants branch 3 times, most recently from 419fcc2 to e82a204 Compare February 24, 2026 22:08
…iders

SAP AI providers now correctly handle Gemini 2.5 models with thinkingConfig
instead of falling back to reasoningEffort which doesn't work for Gemini.

Fixes anomalyco#14957
@jerome-benoit jerome-benoit force-pushed the fix/sap-ai-gemini-thinking-variants branch from e82a204 to 374b84e Compare February 24, 2026 22:13
@github-actions github-actions bot removed the needs:compliance This means the issue will auto-close after 2 hours. label Feb 24, 2026
@github-actions
Copy link
Contributor

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

Use word boundary (\b) instead of --o pattern to correctly match o1, o3, o3-mini models.
@jerome-benoit jerome-benoit force-pushed the fix/sap-ai-gemini-thinking-variants branch from 74ded42 to 7b72411 Compare February 25, 2026 00:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

SAP AI providers missing Gemini 2.5 thinkingConfig variants

2 participants