Skip to content

fix(formatter): set content to None when tool_calls exists in DeepSeekChatFormatter#1270

Open
yuyuyu-alan wants to merge 1 commit intoagentscope-ai:mainfrom
yuyuyu-alan:fix/deepseek-formatter-tool-calls-content
Open

fix(formatter): set content to None when tool_calls exists in DeepSeekChatFormatter#1270
yuyuyu-alan wants to merge 1 commit intoagentscope-ai:mainfrom
yuyuyu-alan:fix/deepseek-formatter-tool-calls-content

Conversation

@yuyuyu-alan
Copy link
Copy Markdown

Summary

  • Fix DeepSeekChatFormatter to set content to None when tool_calls exists
  • DeepSeek API doesn't allow assistant message to have both content and tool_calls
  • When both exist, DeepSeek interprets it as "interrupted speech" and may repeat the content in the next iteration

Test Plan

  • Added test case test_chat_formatter_with_text_and_tool_use to cover the scenario where a message contains both TextBlock and ToolUseBlock
  • All existing tests pass

🤖 Generated with Claude Code

…kChatFormatter

DeepSeek API doesn't allow assistant message to have both content and
tool_calls. When both exist, DeepSeek interprets it as "interrupted
speech" and may repeat the content in the next iteration.

This fix ensures that when a message contains both TextBlock and
ToolUseBlock, the content field is set to None to avoid this issue.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@gemini-code-assist
Copy link
Copy Markdown
Contributor

Warning

You have reached your daily quota limit. Please wait up to 24 hours and I will start processing your requests again!

@cla-assistant
Copy link
Copy Markdown

cla-assistant bot commented Mar 2, 2026

CLA assistant check
Thank you for your submission! We really appreciate it. Like many open source projects, we ask that you sign our Contributor License Agreement before we can accept your contribution.
You have signed the CLA already but the status is still pending? Let us recheck it.

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.

1 participant