fix(opencode): add thinking variants support for SAP AI provider#14958
Merged
rekram1-node merged 40 commits intoanomalyco:devfrom Mar 10, 2026
Merged
Conversation
Contributor
There was a problem hiding this comment.
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
thinkingConfigwiththinkingBudgetvalues matching the native@ai-sdk/googleprovider - 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.
419fcc2 to
e82a204
Compare
…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
e82a204 to
374b84e
Compare
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.
74ded42 to
7b72411
Compare
…ovider - Add isAnthropicAdaptive detection for Claude 4.6 models - Keep Gemini 2.5 thinkingConfig support - Keep GPT/o-series reasoningEffort support - Return empty object for unsupported models instead of fallback - Add unit test for Claude 4.6 adaptive thinking
jerome-benoit
added a commit
to jerome-benoit/dotfiles
that referenced
this pull request
Mar 2, 2026
… and bun provider tracking Cherry-pick three upstream PRs: - anomalyco/opencode#14958: add thinking variant support for SAP AI provider - anomalyco/opencode#12822: remove Env namespace, use direct process.env access - anomalyco/opencode#10275: track provider packages with reference counting for cleanup
Contributor
Author
|
@rekram1-node @nexxeln: could you please have a look at that PR, since anomalyco/models.dev#1020 have been already merged. Thanks. |
Collaborator
|
been on vacation for 2 weeks just got back |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Issue for this PR
Closes #14957
Type of change
What does this PR do?
Adds proper thinking/reasoning variant support for SAP AI provider (
@jerome-benoit/sap-ai-provider-v2), harmonized with existing transverse variant handling.Changes:
isAnthropicAdaptivedetection (transverse variable at line 336) to apply{ thinking: { type: "adaptive" }, effort }config, matching@ai-sdk/anthropicand@ai-sdk/amazon-bedrockimplementations{ thinkingConfig: { includeThoughts: true, thinkingBudget } }with budget values matching@ai-sdk/googleprovider{ reasoningEffort }for OpenAI-compatible reasoning{}instead of incorrectreasoningEffortfallbackThe implementation reuses existing constants (
adaptiveEfforts,WIDELY_SUPPORTED_EFFORTS) and follows the established pattern from other provider cases.How did you verify your code works?
Screenshots / recordings
N/A - no UI changes
Checklist