Skip to content

fix(cli): preserve empty reasoning_content in interleaved transform - #9470

Merged
chrarnoldus merged 2 commits into
mainfrom
fix/cli-preserve-empty-reasoning-content
Apr 24, 2026
Merged

fix(cli): preserve empty reasoning_content in interleaved transform#9470
chrarnoldus merged 2 commits into
mainfrom
fix/cli-preserve-empty-reasoning-content

Conversation

@kilo-code-bot

@kilo-code-bot kilo-code-bot Bot commented Apr 24, 2026

Copy link
Copy Markdown
Contributor

Cherry-picks anomalyco/opencode#24146.

DeepSeek thinking mode can return empty reasoning_content on assistant messages in a tool call chain, which must be sent back verbatim in subsequent requests. The interleaved transform's truthy check was dropping it, causing multi-turn tool calls to fail with The 'reasoning_content' in the thinking mode must be passed back to the API. The fix always sets providerOptions.openaiCompatible[field] for assistant messages so the AI SDK's metadata spread carries the empty string through.

@kilo-code-bot

kilo-code-bot Bot commented Apr 24, 2026

Copy link
Copy Markdown
Contributor Author

Code Review Summary

Status: No Issues Found | Recommendation: Merge

Files Reviewed (2 files)
  • .changeset/deepseek-empty-reasoning.md
  • packages/opencode/src/provider/transform.ts

Reviewed by gpt-5.4-20260305 · 312,956 tokens

@kilo-code-bot
kilo-code-bot Bot force-pushed the fix/cli-preserve-empty-reasoning-content branch from a2773d1 to c68c97a Compare April 24, 2026 14:22
heimoshuiyu and others added 2 commits April 24, 2026 14:30
DeepSeek thinking mode may return empty reasoning_content on assistant
messages in a tool call chain, which must be sent back in subsequent
requests. The interleaved transform's truthy check was dropping it.

Always set providerOptions.openaiCompatible[field] for assistant
messages so the AI SDK's metadata spread carries it through.

Cherry-picked from anomalyco/opencode#24146 (931e6ed).
@kilo-code-bot
kilo-code-bot Bot force-pushed the fix/cli-preserve-empty-reasoning-content branch from c68c97a to 7fe4508 Compare April 24, 2026 14:31
@chrarnoldus chrarnoldus linked an issue Apr 24, 2026 that may be closed by this pull request
1 task
@chrarnoldus
chrarnoldus merged commit ef209e0 into main Apr 24, 2026
18 of 20 checks passed
@chrarnoldus
chrarnoldus deleted the fix/cli-preserve-empty-reasoning-content branch April 24, 2026 15:07
jliounis pushed a commit to jliounis/kilocode that referenced this pull request May 18, 2026
…-reasoning-content

fix(cli): preserve empty reasoning_content in interleaved transform
t7tran pushed a commit to t7tran/kilocode that referenced this pull request Aug 14, 2026
…-reasoning-content

fix(cli): preserve empty reasoning_content in interleaved transform
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[FEATURE]:Add support for the new DeepSeek model

3 participants