You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
sap-ai-core: Claude models fail with 400 "does not support assistant message prefill" #45313
OpenCode Version: 1.18.23 Provider:sap-ai-core Model:sap-ai-core/anthropic--claude-4.6-sonnet (affects all sap-ai-core/anthropic--* models)
Description
When using any Anthropic/Claude model through the SAP AI Core provider, every response is followed by a 400 error:
400 - LLM Module: This model does not support assistant message prefill.
The conversation must end with a user message.
Steps to Reproduce
Configure OpenCode with sap-ai-core provider and any anthropic--* model
Send any message (e.g. "Hi")
Receive a response
Observe 400 error immediately after
Root Cause
OpenCode appends a partial assistant message at the end of the conversation (assistant prefill) to steer the model's response. The SAP AI Core Orchestration API rejects this — it requires conversations to always end with a user message.
Your issue is specific to the SAP AI Core provider, but the underlying cause (OpenCode appending a trailing assistant message that SAP AI Core / Anthropic rejects) is shared with the above. It may be worth coordinating with those threads or checking if an existing fix covers this provider.
Thanks for the report! OpenCode 2.0 is now out and development is focused on V2, so we're closing issues filed against OpenCode 1. Please upgrade (opencode upgrade --major, details: https://anoma.ly/notes/opencode-2-0), and if this is still relevant on 2.0, reopen this issue or open a new one with your 2.0 version.
Activity
github-actions commentedon Aug 26, 2026
This issue might be a duplicate of existing issues. Please check:
Your issue is specific to the SAP AI Core provider, but the underlying cause (OpenCode appending a trailing assistant message that SAP AI Core / Anthropic rejects) is shared with the above. It may be worth coordinating with those threads or checking if an existing fix covers this provider.
thdxr commentedon Oct 11, 2026
Thanks for the report! OpenCode 2.0 is now out and development is focused on V2, so we're closing issues filed against OpenCode 1. Please upgrade (
opencode upgrade --major, details: https://anoma.ly/notes/opencode-2-0), and if this is still relevant on 2.0, reopen this issue or open a new one with your 2.0 version.— from 𝕺𝖕𝖊𝖓𝕮𝖔𝖉𝖊