Uh oh!
There was an error while loading. Please reload this page.
fix(opencode): add thinking variants support for SAP AI provider - #14958
Conversation
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.
Uh oh!
There was an error while loading. Please reload this page.
419fcc2 to
e82a204Compare…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. Fixesanomalyco#14957
e82a204 to
374b84eCompareThanks 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
7b72411Compare…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
… 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
rekram1-node
commented
Mar 10, 2026
been on vacation for 2 weeks just got back |
Uh oh!
There was an error while loading. Please reload this page.
…malyco#14958) Co-authored-by: Test <test@test.com> Co-authored-by: Stephen Collings <stevoland@gmail.com>
…malyco#14958) Co-authored-by: Test <test@test.com> Co-authored-by: Stephen Collings <stevoland@gmail.com>
…malyco#14958) Co-authored-by: Test <test@test.com> Co-authored-by: Stephen Collings <stevoland@gmail.com>
…malyco#14958) Co-authored-by: Test <test@test.com> Co-authored-by: Stephen Collings <stevoland@gmail.com>
…malyco#14958) Co-authored-by: Test <test@test.com> Co-authored-by: Stephen Collings <stevoland@gmail.com>
…malyco#14958) Co-authored-by: Test <test@test.com> Co-authored-by: Stephen Collings <stevoland@gmail.com>
…malyco#14958) Co-authored-by: Test <test@test.com> Co-authored-by: Stephen Collings <stevoland@gmail.com>
…malyco#14958) Co-authored-by: Test <test@test.com> Co-authored-by: Stephen Collings <stevoland@gmail.com>
…malyco#14958) Co-authored-by: Test <test@test.com> Co-authored-by: Stephen Collings <stevoland@gmail.com>
…malyco#14958) Co-authored-by: Test <test@test.com> Co-authored-by: Stephen Collings <stevoland@gmail.com>
…958) Co-authored-by: Test <test@test.com> Co-authored-by: Stephen Collings <stevoland@gmail.com>
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