Description
opencode emits SAP AI Core reasoning variants at the top level of providerOptions['sap-ai-core']:
- GPT family:
{ reasoningEffort: "high" }
- Claude (Bedrock-routed):
{ thinking: { type: "adaptive" }, effort } adaptive, or { thinking: { type: "enabled", budgetTokens } } non-adaptive
- Gemini (Vertex-routed):
{ thinkingConfig: { includeThoughts, thinkingBudget } }
The @jerome-benoit/sap-ai-provider-v2 Zod schema only declares {api, escapeTemplatePlaceholders, includeReasoning, modelParams, orchestrationConfigRef, placeholderValues, promptTemplateRef} at top level. Unknown keys are silently stripped, so none of these reasoning controls ever reach the SAP SDKs or the upstream backends.
Fix
modelParams has .catchall(z.unknown()) and is forwarded verbatim by both SAP SDKs into request.model.params (orchestration API) or top-level body fields (foundation-models API). Reasoning controls must live under modelParams, using each backend's native REST field names: reasoning_effort for Azure OpenAI, thinking + output_config for Bedrock-routed Claude, thinkingConfig for Vertex-routed Gemini.
Steps to reproduce
git checkout dev
bun install
bun test packages/opencode/test/provider/transform.test.ts
The existing SAP tests assert the dropped shape but never the wire body, so they pass while runtime behavior is broken.
OpenCode version
dev @ dc216e8b0
Description
opencode emits SAP AI Core reasoning variants at the top level of
providerOptions['sap-ai-core']:{ reasoningEffort: "high" }{ thinking: { type: "adaptive" }, effort }adaptive, or{ thinking: { type: "enabled", budgetTokens } }non-adaptive{ thinkingConfig: { includeThoughts, thinkingBudget } }The
@jerome-benoit/sap-ai-provider-v2Zod schema only declares{api, escapeTemplatePlaceholders, includeReasoning, modelParams, orchestrationConfigRef, placeholderValues, promptTemplateRef}at top level. Unknown keys are silently stripped, so none of these reasoning controls ever reach the SAP SDKs or the upstream backends.Fix
modelParamshas.catchall(z.unknown())and is forwarded verbatim by both SAP SDKs intorequest.model.params(orchestration API) or top-level body fields (foundation-models API). Reasoning controls must live undermodelParams, using each backend's native REST field names:reasoning_effortfor Azure OpenAI,thinking+output_configfor Bedrock-routed Claude,thinkingConfigfor Vertex-routed Gemini.Steps to reproduce
git checkout dev bun install bun test packages/opencode/test/provider/transform.test.tsThe existing SAP tests assert the dropped shape but never the wire body, so they pass while runtime behavior is broken.
OpenCode version
dev @
dc216e8b0