For the agent nodes in chatflow, if there are multi-round calls, the part with "thinking" will be nested layer by layer, resulting in the final answer not being able to be output #20109

Closed
opened 2026-02-21 20:05:53 -05:00 by yindo · 4 comments
Owner

Originally created by @auxpd on GitHub (Nov 3, 2025).

Self Checks

  • I have read the Contributing Guide and Language Policy.
  • This is only for bug report, if you would like to ask a question, please head to Discussions.
  • I have searched for existing issues search for existing issues, including closed ones.
  • I confirm that I am using English to submit this report, otherwise it will be closed.
  • 【中文用户 & Non English User】请使用英语提交,否则会被关闭 :)
  • Please do not modify this template :) and fill in all the required fields.

Dify version

1.9.1

Cloud or Self Hosted

Self Hosted (Docker)

Steps to reproduce

node details:

Image Image

This is the phenomenon:
Image

Image

✔️ Expected Behavior

Correctly display multiple deep thoughts and correctly return the final answer

Actual Behavior

After starting to nest, all the information is folded into "Deep Thought", and finally no answer is output

Originally created by @auxpd on GitHub (Nov 3, 2025). ### Self Checks - [x] I have read the [Contributing Guide](https://github.com/langgenius/dify/blob/main/CONTRIBUTING.md) and [Language Policy](https://github.com/langgenius/dify/issues/1542). - [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 [search for existing issues](https://github.com/langgenius/dify/issues), including closed ones. - [x] I confirm that I am using English to submit this report, otherwise it will be closed. - [x] 【中文用户 & Non English User】请使用英语提交,否则会被关闭 :) - [x] Please do not modify this template :) and fill in all the required fields. ### Dify version 1.9.1 ### Cloud or Self Hosted Self Hosted (Docker) ### Steps to reproduce node details: <img width="299" height="220" alt="Image" src="https://github.com/user-attachments/assets/6b0f938f-8627-4205-ab01-a74e386991c3" /> <img width="273" height="228" alt="Image" src="https://github.com/user-attachments/assets/f06f8c91-8367-4346-87f9-dce9faf6abe1" /> This is the phenomenon: <img width="368" height="113" alt="Image" src="https://github.com/user-attachments/assets/1d5bd1d4-1820-405e-82fb-6cb4edaf3871" /> <img width="345" height="97" alt="Image" src="https://github.com/user-attachments/assets/54cd6b7c-0400-4eb5-a19f-6c1bc2abc660" /> ### ✔️ Expected Behavior Correctly display multiple deep thoughts and correctly return the final answer ### ❌ Actual Behavior After starting to nest, all the information is folded into "Deep Thought", and finally no answer is output
yindo added the 🐞 bug label 2026-02-21 20:05:53 -05:00
yindo closed this issue 2026-02-21 20:05:53 -05:00
Author
Owner

@dosubot[bot] commented on GitHub (Nov 3, 2025):

This is a known bug in Dify v1.9.1: when agent nodes perform multi-round calls, the "thinking" steps get nested and all information folds into a single "Deep Thought" block, preventing the final answer from being output. The root cause is usually incomplete or missing <think> tags in the model output, which the frontend relies on to close the deep thinking panel and display the answer. If the tag is missing or truncated (often due to model output limits), the timer and output get stuck or nested incorrectly details.

Permanent fixes require changes to flatten agent thoughts and ensure stop events propagate correctly across nested steps. This limitation affects current versions, including v1.9.1 details. A recent update (PR #23313, merged 2025-09-05) added a reasoning format configuration for LLM nodes, letting you choose between "tagged" and "separated" formats for handling <think> tags. The "separated" mode extracts reasoning content to a separate field, helping to separate deep thinking results from the final output. This feature is not available in v1.9.1 and requires upgrading to a newer version details.

Workarounds for your current version include: increasing the model's max_tokens setting, reducing chunk size for knowledge base documents, validating backend output for complete <think> tags, or adding manual dismiss options or timeouts in the frontend to clear stuck timers. These may help but do not fully resolve the nesting issue details. Some users report that switching to a local model or adjusting reference length settings may help, as certain large models have stricter output or reference length limits that can exacerbate the issue details.

If you need clean separation of reasoning and final output, upgrading to a version with the new reasoning format configuration is recommended.

To reply, just mention @dosu.


How did I do? Good | Irrelevant | Incorrect | Verbose | Hallucination | Report 🐛 | Other  Chat with Dosu Join Discord Share on X

@dosubot[bot] commented on GitHub (Nov 3, 2025): <!-- Answer --> This is a known bug in Dify v1.9.1: when agent nodes perform multi-round calls, the "thinking" steps get nested and all information folds into a single "Deep Thought" block, preventing the final answer from being output. The root cause is usually incomplete or missing `<think>` tags in the model output, which the frontend relies on to close the deep thinking panel and display the answer. If the tag is missing or truncated (often due to model output limits), the timer and output get stuck or nested incorrectly [details](https://github.com/langgenius/dify/issues/25492). Permanent fixes require changes to flatten agent thoughts and ensure stop events propagate correctly across nested steps. This limitation affects current versions, including v1.9.1 [details](https://github.com/langgenius/dify/issues/24869). A recent update (PR #23313, merged 2025-09-05) added a reasoning format configuration for LLM nodes, letting you choose between "tagged" and "separated" formats for handling `<think>` tags. The "separated" mode extracts reasoning content to a separate field, helping to separate deep thinking results from the final output. This feature is not available in v1.9.1 and requires upgrading to a newer version [details](https://github.com/langgenius/dify/issues/25492). Workarounds for your current version include: increasing the model's `max_tokens` setting, reducing chunk size for knowledge base documents, validating backend output for complete `<think>` tags, or adding manual dismiss options or timeouts in the frontend to clear stuck timers. These may help but do not fully resolve the nesting issue [details](https://github.com/langgenius/dify/issues/24869). Some users report that switching to a local model or adjusting reference length settings may help, as certain large models have stricter output or reference length limits that can exacerbate the issue [details](https://github.com/langgenius/dify/issues/16875). If you need clean separation of reasoning and final output, upgrading to a version with the new reasoning format configuration is recommended. <!-- 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/131fda8d-f1d9-43b6-af59-8ee8480112d5?feedback_type=great_response) | [Irrelevant](https://app.dosu.dev/response-feedback/131fda8d-f1d9-43b6-af59-8ee8480112d5?feedback_type=irrelevant_answer) | [Incorrect](https://app.dosu.dev/response-feedback/131fda8d-f1d9-43b6-af59-8ee8480112d5?feedback_type=incorrect_sources) | [Verbose](https://app.dosu.dev/response-feedback/131fda8d-f1d9-43b6-af59-8ee8480112d5?feedback_type=too_verbose) | [Hallucination](https://app.dosu.dev/response-feedback/131fda8d-f1d9-43b6-af59-8ee8480112d5?feedback_type=hallucination) | [Report 🐛](https://app.dosu.dev/response-feedback/131fda8d-f1d9-43b6-af59-8ee8480112d5?feedback_type=bug_report) | [Other](https://app.dosu.dev/response-feedback/131fda8d-f1d9-43b6-af59-8ee8480112d5?feedback_type=other)</sup>&nbsp;&nbsp;[![Chat with Dosu](https://dosu.dev/dosu-chat-badge.svg)](https://app.dosu.dev/6088a4f4-073a-43f3-b3d4-4f06fb0c05a0/ask?utm_source=github)&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/issues/27796)
Author
Owner

@auxpd commented on GitHub (Nov 4, 2025):

I replaced Gemini 2.5 pro. The multiple "thinkings" in the output are normal (the model above uses gpt5). I think the judgment of "thinking" here lacks robustness.

Image
@auxpd commented on GitHub (Nov 4, 2025): I replaced Gemini 2.5 pro. The multiple "thinkings" in the output are normal (the model above uses gpt5). I think the judgment of "thinking" here lacks robustness. <img width="309" height="472" alt="Image" src="https://github.com/user-attachments/assets/c7e59a9c-2207-4ddd-9ee5-8fb9870e70a2" />
Author
Owner

@nicho2 commented on GitHub (Dec 1, 2025):

I have the same thing with gpt_oss_20b (Dify : 1.10.1)

Image

several are lost
for 4 round: i have 4 and only one

Image Image Image
@nicho2 commented on GitHub (Dec 1, 2025): I have the same thing with gpt_oss_20b (Dify : 1.10.1) <img width="401" height="233" alt="Image" src="https://github.com/user-attachments/assets/8664bc11-a411-4c4a-8682-7452bdb9c106" /> several </think> are lost for 4 round: i have 4 <think> and only one </think> <img width="616" height="498" alt="Image" src="https://github.com/user-attachments/assets/dcd0bbaf-775f-4526-87c4-80340f34268f" /> <img width="359" height="372" alt="Image" src="https://github.com/user-attachments/assets/b3687229-7a6d-49f0-9271-b21107b1d5c1" /> <img width="143" height="139" alt="Image" src="https://github.com/user-attachments/assets/a014b774-d0ed-493b-9b7a-0f25c2cc734b" />
Author
Owner

@dosubot[bot] commented on GitHub (Jan 6, 2026):

Hi, @auxpd. I'm Dosu, and I'm helping the Dify team manage their backlog and am marking this issue as stale.

Issue Summary:

  • You reported a bug in Dify v1.9.1 (self-hosted Docker) where multi-round calls in agent nodes cause nested "thinking" steps that block the final answer display.
  • The problem stems from incomplete or missing <think> tags in the model output, causing frontend handling issues.
  • Partial fixes were introduced in versions after 1.9.1, including a reasoning format configuration to better separate deep thoughts from final answers.
  • You and another user provided examples showing multiple <think> tags without matching closures, highlighting tag handling robustness issues.
  • Workarounds include increasing model token limits or upgrading to newer versions with improved reasoning format support.

Next Steps:

  • Please check if this issue is still relevant with the latest version of Dify; if so, feel free to keep the discussion open by commenting here.
  • Otherwise, I will automatically close this issue in 15 days.

Thank you for your understanding and contribution!

@dosubot[bot] commented on GitHub (Jan 6, 2026): Hi, @auxpd. I'm [Dosu](https://dosu.dev), and I'm helping the Dify team manage their backlog and am marking this issue as stale. **Issue Summary:** - You reported a bug in Dify v1.9.1 (self-hosted Docker) where multi-round calls in agent nodes cause nested "thinking" steps that block the final answer display. - The problem stems from incomplete or missing `<think>` tags in the model output, causing frontend handling issues. - Partial fixes were introduced in versions after 1.9.1, including a reasoning format configuration to better separate deep thoughts from final answers. - You and another user provided examples showing multiple `<think>` tags without matching closures, highlighting tag handling robustness issues. - Workarounds include increasing model token limits or upgrading to newer versions with improved reasoning format support. **Next Steps:** - Please check if this issue is still relevant with the latest version of Dify; if so, feel free to keep the discussion open by commenting here. - Otherwise, I will automatically close this issue in 15 days. Thank you for your understanding and contribution!
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: langgenius/dify#20109