mirror of
https://github.com/langgenius/dify-official-plugins.git
synced 2026-07-22 01:55:27 -04:00
[Tongyi] <think> tag fails to close when using gml4.7 model with reasoning mode in Agent node #941
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 @TsuneZebra on GitHub (Jan 19, 2026).
Self Checks
Dify version
1.11.2
Plugin version
0.1.19
Cloud or Self Hosted
Self Hosted (Docker)
Steps to reproduce
✔️ Error log
The
<think>tag is opened, but the closing</think>tag is missing or not rendered correctly. This causes formatting issues in the UI and prevents the subsequent response from being parsed properly.@dosubot[bot] commented on GitHub (Jan 19, 2026):
This is a known bug with reasoning mode and the gml4.7 (Tongyi/Qwen) model: the
<think>tag sometimes isn't closed properly, causing UI and parsing issues. The root cause is that the plugin streams areasoning_contentfield with empty or newline content, which Dify renders as<think>blocks—leading to unclosed or multiple tags, especially with plugin versions 0.0.28–0.0.30 and vLLM inference. This regression did not occur in 0.0.27 and is not unique to gml4.7; it affects other "thinking" models as well [source].Recent PRs (like #2228) for Tongyi/Qwen models force-close
</think>tags if a tool call starts while reasoning is active, which addresses the main cause of unclosed tags. However, your plugin version (0.1.19) may not include all these fixes.Workarounds you can try:
reasoning_formattoseparatedin your workflow node config to extract and hide empty<think>tags from the main output. This helps, but doesn't always fully resolve the issue if empty or redundant tags are not filtered out [source].<think>tags on the frontend or via post-processing if you want to suppress them entirely.enable_thinkingis set tofalsein your model config or API payload (e.g.,chat_template_kwargs: {"enable_thinking": false}), though in some plugin versions this may not fully suppress the tags.Permanent fixes are being rolled out as model providers transition to using the
reasoning_contentattribute instead of inserting<think>tags directly in output content. Upgrading to a newer plugin/core version with the latest fixes (including PR #2228 and reasoning format controls) is the most reliable long-term solution [source].Let me know if you want example code for frontend filtering or more details on patching the backend.
To reply, just mention @dosu.
How did I do? Good | Irrelevant | Incorrect | Verbose | Hallucination | Report 🐛 | Other
@crazywoola commented on GitHub (Feb 3, 2026):
Hi @TsuneZebra, thanks for opening this issue.
Why this is being closed
Dify issue tracking requires English-only issue title and description for consistent collaboration.
Next steps
Please open a new issue in English and include clear details so maintainers can help efficiently.
Thanks for understanding and for your support.