mirror of
https://github.com/langgenius/dify-plugin-sdks.git
synced 2026-07-22 02:15:22 -04:00
[Badcase] Agent with Qwen3 will unexpectedly add a <think> wrapper #39
Reference in New Issue
Block a user
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @miracoco on GitHub (May 21, 2025).
Environment
Model Configuration:
structured outputstreaming function callingDescription
When I developing a agent workflow, I found that the agent will output a nested thinking content. I had starting to figure out causation.
I download the agent plugin and logged the LLM generated content
In the response, there is double
<think><think>.Then, I downloaded the
dify-official-pluginsrepo and dump the original response from LLM. The LLM's output is includes only 1<think>tag.Finally, I notice the call
_wrap_thinking_by_reasoning_contentIt will add an additional
<think>within the content, even the LLM was also provided a<think>.What I did
Comment the think manipulation procedure
After that, the redundant
<think>was got rid.Expectation
I think
_wrap_thinking_by_reasoning_contentis helpful for most models with adding a clear<think>, but Qwen3 is a exception. So, I think there should have some check to decide whether enable the auto think completion.