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
Interleaved reasoning_content lost for non-Claude models on Anthropic SDK #14638
When non-Claude models (e.g. kimi-k2.5) are configured via the Anthropic SDK (@ai-sdk/anthropic) with interleaved reasoning capability, reasoning content from previous assistant turns is silently dropped in subsequent requests.
The root cause is that the Anthropic SDK only knows how to serialize thinking blocks — it has no concept of a top-level reasoning_content field on assistant messages. So when opencode replays prior assistant messages that contain reasoning parts, the SDK discards them and the upstream API never receives the reasoning history.
Steps to reproduce
Configure a non-Claude model (e.g. kimi-k2.5) using @ai-sdk/anthropic provider
Enable thinking/reasoning
Have a multi-turn conversation where the model produces reasoning content
Observe that on subsequent turns, the prior reasoning content is missing from the request sent to the API
The root cause described here (Anthropic SDK only serializing thinking blocks and dropping reasoning_content) may be a distinct variant, but the underlying problem domain overlaps significantly.
Activity
github-actions commentedon Feb 22, 2026
This issue might be a duplicate of existing issues. Please check:
reasoning_detailsfield causing 400 errors on subsequent turns)reasoning_contentfrom prior turns accumulates in context for DeepSeek modelsThe root cause described here (Anthropic SDK only serializing
thinkingblocks and droppingreasoning_content) may be a distinct variant, but the underlying problem domain overlaps significantly.zwhe99 commentedon Apr 11, 2026
I’m also running into this issue. Any updates on this?
llc1123 commentedon Apr 11, 2026
Just use
@ai-sdk/openai-compatible.github-actions commentedon Jul 4, 2026
To stay organized issues are automatically closed after 60 days of no activity. If the issue is still relevant please open a new one.