Skip to content

SAP AI provider missing adaptive reasoning + display:"summarized" for Anthropic Opus 4.7+ #29990

@jerome-benoit

Description

@jerome-benoit

Description

@jerome-benoit/sap-ai-provider-v2 Anthropic Claude Opus 4.7+ models on SAP AI Core do not get adaptive reasoning with display: "summarized", unlike @ai-sdk/anthropic, @ai-sdk/google-vertex/anthropic, and @ai-sdk/amazon-bedrock.

Three issues in packages/opencode/src/provider/transform.ts:

  1. anthropicOpus47OrLater regex /opus-(\d+)[.-](\d+)(?:[.@-]|$)/i requires opus- BEFORE the version. SAP AI Core uses an inverted format anthropic--claude-4.7-opus (family at the end), so the regex never matches.
  2. anthropicAdaptiveEfforts substring list ["opus-4-6", "opus-4.6", "sonnet-4-6", "sonnet-4.6"] does not match anthropic--claude-4.6-opus either, so SAP Opus 4.6 also misses the 4-effort adaptive path.
  3. The @jerome-benoit/sap-ai-provider-v2 case in variants() does not spread ...(adaptiveOpus ? { display: "summarized" } : {}) like @ai-sdk/anthropic (line ~845) and @ai-sdk/amazon-bedrock (line ~882) do.

Plugins

N/A

OpenCode version

dev

Steps to reproduce

  1. Configure SAP AI Core with anthropic--claude-4.7-opus
  2. Select reasoning variant (high/xhigh/max)
  3. Expected: { thinking: { type: "adaptive", display: "summarized" }, effort } and 5 efforts (low|medium|high|xhigh|max)
  4. Actual: { thinking: { type: "enabled", budgetTokens: ... } } (budget-tokens fallback) — no adaptive, no display: "summarized", only 2 keys (high, max)

Authoritative model ID confirmed in SAP/ai-sdk-java, SAP/ai-sdk-js (scripts/sap-models.json and model-types.ts), and models.dev TOML (reasoning = true).

Operating System

macOS

Terminal

iTerm2

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type
No fields configured for issues without a type.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions