[Tongyi] <think> tag fails to close when using gml4.7 model with reasoning mode in Agent node #941

Open
opened 2026-02-16 10:21:04 -05:00 by yindo · 2 comments
Owner

Originally created by @TsuneZebra on GitHub (Jan 19, 2026).

Self Checks

  • This is only for bug report, if you would like to ask a question, please head to Discussions.
  • I have searched for existing issues Dify issues & Dify Official Plugins, including closed ones.
  • I confirm that I am using English to submit this report (我已阅读并同意 Language Policy).
  • [FOR CHINESE USERS] 请务必使用英文提交 Issue,否则会被关闭。谢谢!:)
  • Please do not modify this template :) and fill in all the required fields.

Dify version

1.11.2

Plugin version

0.1.19

Cloud or Self Hosted

Self Hosted (Docker)

Steps to reproduce

  1. Create or open an Agent node in the workflow.
  2. Select the gml4.7 model.
  3. Enable the Reasoning/Thought Mode.
  4. Execute the node or trigger a conversation that invokes the model's reasoning capabilities.

✔️ 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.

Originally created by @TsuneZebra on GitHub (Jan 19, 2026). ### Self Checks - [x] This is only for bug report, if you would like to ask a question, please head to [Discussions](https://github.com/langgenius/dify/discussions/categories/general). - [x] I have searched for existing issues [Dify issues](https://github.com/langgenius/dify/issues) & [Dify Official Plugins](https://github.com/langgenius/dify-official-plugins/issues), including closed ones. - [x] I confirm that I am using English to submit this report (我已阅读并同意 [Language Policy](https://github.com/langgenius/dify/issues/1542)). - [x] [FOR CHINESE USERS] 请务必使用英文提交 Issue,否则会被关闭。谢谢!:) - [x] Please do not modify this template :) and fill in all the required fields. ### Dify version 1.11.2 ### Plugin version 0.1.19 ### Cloud or Self Hosted Self Hosted (Docker) ### Steps to reproduce 1. Create or open an **Agent node** in the workflow. 2. Select the **gml4.7** model. 3. Enable the **Reasoning/Thought Mode**. 4. Execute the node or trigger a conversation that invokes the model's reasoning capabilities. ### ✔️ 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.
yindo added the bug label 2026-02-16 10:21:04 -05:00
Author
Owner

@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 a reasoning_content field 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:

  • Set reasoning_format to separated in 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].
  • Filter out <think> tags on the frontend or via post-processing if you want to suppress them entirely.
  • Ensure enable_thinking is set to false in 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.
  • If you need a code-level workaround, patch the backend/plugin to suppress empty reasoning content before it reaches the UI.

Permanent fixes are being rolled out as model providers transition to using the reasoning_content attribute 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

Open in Cursor Join Discord Share on X

@dosubot[bot] commented on GitHub (Jan 19, 2026): <!-- Answer --> 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 a `reasoning_content` field 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]](https://github.com/langgenius/dify-official-plugins/issues/2447#issuecomment-3763298604). Recent PRs (like [#2228](https://github.com/langgenius/dify-official-plugins/pull/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:** - Set `reasoning_format` to `separated` in 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]](https://github.com/langgenius/dify-official-plugins/issues/2447#issuecomment-3763298604). - Filter out `<think>` tags on the frontend or via post-processing if you want to suppress them entirely. - Ensure `enable_thinking` is set to `false` in 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. - If you need a code-level workaround, patch the backend/plugin to suppress empty reasoning content before it reaches the UI. Permanent fixes are being rolled out as model providers transition to using the `reasoning_content` attribute 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]](https://github.com/langgenius/dify-official-plugins/pull/2228). Let me know if you want example code for frontend filtering or more details on patching the backend. <!-- Dosu Comment Footer --> *To reply, just mention [@dosu](https://go.dosu.dev/dosubot).* --- <sup>How did I do? [Good](https://app.dosu.dev/response-feedback/0a209051-0772-4950-b9a6-000a22fadcb1?feedback_type=great_response) | [Irrelevant](https://app.dosu.dev/response-feedback/0a209051-0772-4950-b9a6-000a22fadcb1?feedback_type=irrelevant_answer) | [Incorrect](https://app.dosu.dev/response-feedback/0a209051-0772-4950-b9a6-000a22fadcb1?feedback_type=incorrect_sources) | [Verbose](https://app.dosu.dev/response-feedback/0a209051-0772-4950-b9a6-000a22fadcb1?feedback_type=too_verbose) | [Hallucination](https://app.dosu.dev/response-feedback/0a209051-0772-4950-b9a6-000a22fadcb1?feedback_type=hallucination) | [Report 🐛](https://app.dosu.dev/response-feedback/0a209051-0772-4950-b9a6-000a22fadcb1?feedback_type=bug_report) | [Other](https://app.dosu.dev/response-feedback/0a209051-0772-4950-b9a6-000a22fadcb1?feedback_type=other)</sup> [![Open in Cursor](https://dosu.dev/dosu-in-cursor.svg)](https://cursor.com/link/prompt?text=This%20is%20a%20known%20bug%20with%20reasoning%20mode%20and%20the%20gml4.7%20%28Tongyi/Qwen%29%20model%3A%20the%20%60%3Cthink%3E%60%20tag%20sometimes%20isn%27t%20closed%20properly%2C%20causing%20UI%20and%20parsing%20issues.%20The%20root%20cause%20is%20that%20the%20plugin%20streams%20a%20%60reasoning_content%60%20field%20with%20empty%20or%20newline%20content%2C%20which%20Dify%20renders%20as%20%60%3Cthink%3E%60%20blocks%E2%80%94leading%20to%20unclosed%20or%20multiple%20tags%2C%20especially%20with%20plugin%20versions%200.0.28%E2%80%930.0.30%20and%20vLLM%20inference.%20This%20regression%20did%20not%20occur%20in%200.0.27%20and%20is%20not%20unique%20to%20gml4.7%3B%20it%20affects%20other%20%22thinking%22%20models%20as%20well%20%5B%5Bsource%5D%5D%28https%3A//github.com/langgenius/dify-official-plugins/issues/2447%23issuecomment-3763298604%29.%0A%0ARecent%20PRs%20%28like%20%5B%232228%5D%28https%3A//github.com/langgenius/dify-official-plugins/pull/2228%29%29%20for%20Tongyi/Qwen%20models%20force-close%20%60%3C/think%3E%60%20tags%20if%20a%20tool%20call%20starts%20while%20reasoning%20is%20active%2C%20which%20addresses%20the%20main%20cause%20of%20unclosed%20tags.%20However%2C%20your%20plugin%20version%20%280.1.19%29%20may%20not%20include%20all%20these%20fixes.%0A%0A%2A%2AWorkarounds%20you%20can%20try%3A%2A%2A%0A-%20Set%20%60reasoning_format%60%20to%20%60separated%60%20in%20your%20workflow%20node%20config%20to%20extract%20and%20hide%20empty%20%60%3Cthink%3E%60%20tags%20from%20the%20main%20output.%20This%20helps%2C%20but%20doesn%27t%20always%20fully%20resolve%20the%20issue%20if%20empty%20or%20redundant%20tags%20are%20not%20filtered%20out%20%5B%5Bsource%5D%5D%28https%3A//github.com/langgenius/dify-official-plugins/issues/2447%23issuecomment-3763298604%29.%0A-%20Filter%20out%20%60%3Cthink%3E%60%20tags%20on%20the%20frontend%20or%20via%20post-processing%20if%20you%20want%20to%20suppress%20them%20entirely.%0A-%20Ensure%20%60enable_thinking%60%20is%20set%20to%20%60false%60%20in%20your%20model%20config%20or%20API%20payload%20%28e.g.%2C%20%60chat_template_kwargs%3A%20%7B%22enable_thinking%22%3A%20false%7D%60%29%2C%20though%20in%20some%20plugin%20versions%20this%20may%20not%20fully%20suppress%20the%20tags.%0A-%20If%20you%20need%20a%20code-level%20workaround%2C%20patch%20the%20backend/plugin%20to%20suppress%20empty%20reasoning%20content%20before%20it%20reaches%20the%20UI.%0A%0APermanent%20fixes%20are%20being%20rolled%20out%20as%20model%20providers%20transition%20to%20using%20the%20%60reasoning_content%60%20attribute%20instead%20of%20inserting%20%60%3Cthink%3E%60%20tags%20directly%20in%20output%20content.%20Upgrading%20to%20a%20newer%20plugin/core%20version%20with%20the%20latest%20fixes%20%28including%20PR%20%232228%20and%20reasoning%20format%20controls%29%20is%20the%20most%20reliable%20long-term%20solution%20%5B%5Bsource%5D%5D%28https%3A//github.com/langgenius/dify-official-plugins/pull/2228%29.%0A%0ALet%20me%20know%20if%20you%20want%20example%20code%20for%20frontend%20filtering%20or%20more%20details%20on%20patching%20the%20backend.)&nbsp;[![Join Discord](https://img.shields.io/badge/join-5865F2?logo=discord&logoColor=white&label=)](https://go.dosu.dev/discord-bot)&nbsp;[![Share on X](https://img.shields.io/badge/X-share-black)](https://twitter.com/intent/tweet?text=%40dosu_ai%20helped%20me%20solve%20this%20issue!&url=https%3A//github.com/langgenius/dify-official-plugins/issues/2455)
Author
Owner

@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.

@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.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: langgenius/dify-official-plugins#941