Agent with “Thinking Model”: first “Deep Thinking…” indicator never stops after final answer #16313

Open
opened 2026-02-21 19:25:36 -05:00 by yindo · 4 comments
Owner

Originally created by @caffbyte on GitHub (Aug 20, 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.7.2

Cloud or Self Hosted

Self Hosted (Docker)

Steps to reproduce

  1. Create/open an Agent with Thinking Model enabled.
  2. Ask a question that triggers Knowledge Base retrieval.
  3. Wait until the Agent outputs the final answer completely.
  4. Observe the first “Deep Thinking…” indicator.

✔️ Expected Behavior

The first “Deep Thinking…” indicator should automatically stop once the final answer is fully output.

Actual Behavior

The first “Deep Thinking…” indicator remains loading/spinning and never stops, even after the final answer is produced. It only disappears if the page is refresh

Image
Originally created by @caffbyte on GitHub (Aug 20, 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.7.2 ### Cloud or Self Hosted Self Hosted (Docker) ### Steps to reproduce 1. Create/open an Agent with **Thinking Model** enabled. 2. Ask a question that triggers **Knowledge Base retrieval**. 3. Wait until the Agent outputs the final answer completely. 4. Observe the first “Deep Thinking…” indicator. ### ✔️ Expected Behavior The first “Deep Thinking…” indicator should automatically stop once the final answer is fully output. ### ❌ Actual Behavior The first “Deep Thinking…” indicator remains loading/spinning and never stops, even after the final answer is produced. It only disappears if the page is refresh <img width="681" height="189" alt="Image" src="https://github.com/user-attachments/assets/b97a9544-2241-4386-9821-488b26a61610" />
yindo added the 🐞 buggood first issue labels 2026-02-21 19:25:36 -05:00
Author
Owner

@dosubot[bot] commented on GitHub (Aug 20, 2025):

Hi @caffbyte! I'm Dosu and I’m helping the dify team.

The root cause is that the frontend relies on correctly formed <think> tags in the agent's response to stop the "Deep Thinking..." indicator. If the closing tag is missing—often due to model output truncation or max_tokens limits—the indicator gets stuck and won't stop until you refresh the page. This is a known issue with Langgenius/Tongyi models in self-hosted Docker setups on Dify 1.7.x [details].

Workarounds: try increasing your model's max_tokens setting and reduce the chunk size for your knowledge base documents to avoid incomplete output [details]. These steps may help, but don't guarantee a fix.

Recent and upcoming changes may improve this: a new reasoning_format parameter (PR #23313) will let you choose how reasoning output is formatted and parsed, which could help the frontend handle thinking indicators more robustly. Also, agent log handling has been refactored (PR #24080), which may improve indicator state management in newer versions.

For now, if you can't upgrade, consider validating backend output for complete <think> tags, or add a manual dismiss option or timeout in your frontend as a temporary fix.

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 (Aug 20, 2025): <!-- Greeting --> Hi @caffbyte! I'm [Dosu](https://go.dosu.dev/dosubot) and I’m helping the dify team. <!-- Answer --> The root cause is that the frontend relies on correctly formed `<think>` tags in the agent's response to stop the "Deep Thinking..." indicator. If the closing tag is missing—often due to model output truncation or max_tokens limits—the indicator gets stuck and won't stop until you refresh the page. This is a known issue with Langgenius/Tongyi models in self-hosted Docker setups on Dify 1.7.x [[details](https://github.com/langgenius/dify/issues/22948)]. Workarounds: try increasing your model's `max_tokens` setting and reduce the chunk size for your knowledge base documents to avoid incomplete output [[details](https://github.com/langgenius/dify/issues/16875)]. These steps may help, but don't guarantee a fix. Recent and upcoming changes may improve this: a new `reasoning_format` parameter (PR [#23313](https://github.com/langgenius/dify/pull/23313)) will let you choose how reasoning output is formatted and parsed, which could help the frontend handle thinking indicators more robustly. Also, agent log handling has been refactored (PR [#24080](https://github.com/langgenius/dify/pull/24080)), which may improve indicator state management in newer versions. For now, if you can't upgrade, consider validating backend output for complete `<think>` tags, or add a manual dismiss option or timeout in your frontend as a temporary fix. <!-- 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/8e781697-0c13-4ee2-97f5-56e3a1255b55?feedback_type=great_response) | [Irrelevant](https://app.dosu.dev/response-feedback/8e781697-0c13-4ee2-97f5-56e3a1255b55?feedback_type=irrelevant_answer) | [Incorrect](https://app.dosu.dev/response-feedback/8e781697-0c13-4ee2-97f5-56e3a1255b55?feedback_type=incorrect_sources) | [Verbose](https://app.dosu.dev/response-feedback/8e781697-0c13-4ee2-97f5-56e3a1255b55?feedback_type=too_verbose) | [Hallucination](https://app.dosu.dev/response-feedback/8e781697-0c13-4ee2-97f5-56e3a1255b55?feedback_type=hallucination) | [Report 🐛](https://app.dosu.dev/response-feedback/8e781697-0c13-4ee2-97f5-56e3a1255b55?feedback_type=bug_report) | [Other](https://app.dosu.dev/response-feedback/8e781697-0c13-4ee2-97f5-56e3a1255b55?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/24265)
Author
Owner

@caffbyte commented on GitHub (Aug 20, 2025):

I’ve already set max_tokens to the maximum value, but the first “Deep Thinking…” indicator still doesn’t stop after the final answer is produced. It seems the issue is not related to token limits.

This might be related to the frontend not receiving the correct end signal or multi-stage thinking state not being cleared.

Image
@caffbyte commented on GitHub (Aug 20, 2025): I’ve already set max_tokens to the maximum value, but the first “Deep Thinking…” indicator still doesn’t stop after the final answer is produced. It seems the issue is not related to token limits. This might be related to the frontend not receiving the correct end signal or multi-stage thinking state not being cleared. <img width="455" height="552" alt="Image" src="https://github.com/user-attachments/assets/ce4d3d88-5001-450f-a89c-1a82d9739a5a" />
Author
Owner

@liugddx commented on GitHub (Aug 21, 2025):

I will try

@liugddx commented on GitHub (Aug 21, 2025): I will try
Author
Owner

@Lonong commented on GitHub (Aug 25, 2025):

The first thought has no ending tag #22948

@Lonong commented on GitHub (Aug 25, 2025): The first thought has no ending tag</thint> #22948
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: langgenius/dify#16313