Dify Agent Hanging After Tool Usage #12250

Closed
opened 2026-02-21 19:06:34 -05:00 by yindo · 11 comments
Owner

Originally created by @russch on GitHub (Mar 27, 2025).

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 search for existing issues, 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.13

Cloud or Self Hosted

Self Hosted (Docker)

Steps to reproduce

Summary

The Dify Agent becomes unresponsive ("hangs") in conversations after using external tools, specifically when attempting to process follow-up questions.

Tool Integration: Various (Perplexity, Tavily)

Severity

High - Blocks further conversation and requires conversation restart
Steps to Reproduce

Start a new conversation with the Dify Agent
Exchange several messages that don't require tool usage
    Expected: Agent responds normally
    Actual: Agent responds normally
Ask a question that requires tool usage (e.g., search request)
    Expected: Agent uses tool and provides answer
    Actual: Agent uses tool and provides answer correctly
Ask a follow-up question to the tool-assisted response
    Expected: Agent processes and responds to follow-up
    Actual: Agent shows typing indicator (three dots) briefly, then clears
Attempt additional questions
    Expected: Agent processes and responds
    Actual: Status shows partial completion (e.g., "2/2", "3/3", or "4/4") with empty response bubble

✔️ Expected Behavior

I can continue prompting as long as I want.

Image Image

Actual Behavior

Prompts "hang" after a single successful round of using tools

Originally created by @russch on GitHub (Mar 27, 2025). ### 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 [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 (我已阅读并同意 [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.13 ### Cloud or Self Hosted Self Hosted (Docker) ### Steps to reproduce **Summary** The Dify Agent becomes unresponsive ("hangs") in conversations after using external tools, specifically when attempting to process follow-up questions. Tool Integration: Various (Perplexity, Tavily) **Severity** High - Blocks further conversation and requires conversation restart Steps to Reproduce Start a new conversation with the Dify Agent Exchange several messages that don't require tool usage Expected: Agent responds normally Actual: Agent responds normally Ask a question that requires tool usage (e.g., search request) Expected: Agent uses tool and provides answer Actual: Agent uses tool and provides answer correctly Ask a follow-up question to the tool-assisted response Expected: Agent processes and responds to follow-up Actual: Agent shows typing indicator (three dots) briefly, then clears Attempt additional questions Expected: Agent processes and responds Actual: Status shows partial completion (e.g., "2/2", "3/3", or "4/4") with empty response bubble ### ✔️ Expected Behavior I can continue prompting as long as I want. <img width="774" alt="Image" src="https://github.com/user-attachments/assets/3cdbe36d-2f28-4b23-8593-11c05a1b187c" /> <img width="924" alt="Image" src="https://github.com/user-attachments/assets/0080ede2-ee97-4f17-a050-9136112ed1c8" /> ### ❌ Actual Behavior Prompts "hang" after a single successful round of using tools
yindo added the 🐞 bug🤔 cant-reproducestale labels 2026-02-21 19:06:34 -05:00
yindo closed this issue 2026-02-21 19:06:34 -05:00
Author
Owner

@dosubot[bot] commented on GitHub (Mar 27, 2025):

Hey there, @russch! I'm here to help you with any bugs, questions, or contributions. Let's tackle this issue together!

I found a similar unsolved discussion regarding Dify agents timing out due to slow tool responses [1]. This might be related to the issue you're experiencing with the agent hanging after tool usage.

For your specific issue, you might want to check the error handling and timeout mechanisms in place for tool-assisted responses. Dify provides several options, such as setting default values, using fail branches, and configuring error retries, which might help in managing the agent's responsiveness after tool usage [2]. Additionally, you can customize the default timeout settings for tool-assisted responses by modifying the environment variables in the docker/docker-compose.yaml file [3].

These steps might help in addressing the hanging issue you're encountering.

To continue talking to Dosu, mention @dosu.


Help Dosu learn! Give it feedback: Great Response | Irrelevant Answer | Incorrect Sources | Too Verbose | Hallucination | Bug Report | Other

@dosubot[bot] commented on GitHub (Mar 27, 2025): <!-- Greeting --> Hey there, @russch! I'm here to help you with any bugs, questions, or contributions. Let's tackle this issue together! <!-- Answer --> I found a similar unsolved discussion regarding Dify agents timing out due to slow tool responses <sup>[[1]](https://github.com/langgenius/dify/discussions/14716)</sup>. This might be related to the issue you're experiencing with the agent hanging after tool usage. For your specific issue, you might want to check the error handling and timeout mechanisms in place for tool-assisted responses. Dify provides several options, such as setting default values, using fail branches, and configuring error retries, which might help in managing the agent's responsiveness after tool usage <sup>[[2]](https://github.com/langgenius/dify-docs/blob/main/en/guides/workflow/error-handling/predefined-error-handling-logic.md)</sup>. Additionally, you can customize the default timeout settings for tool-assisted responses by modifying the environment variables in the `docker/docker-compose.yaml` file <sup>[[3]](https://github.com/langgenius/dify/blob/main/docker/docker-compose.yaml)</sup>. These steps might help in addressing the hanging issue you're encountering. <!-- Dosu Comment Footer --> *To continue talking to [Dosu](https://dosu.dev), mention @dosu.* --- <sup>Help Dosu learn! Give it feedback: [Great Response](https://app.dosu.dev/response-feedback/f48e393e-ce11-42a0-b2ab-403c65669698?feedback_type=great_response) | [Irrelevant Answer](https://app.dosu.dev/response-feedback/f48e393e-ce11-42a0-b2ab-403c65669698?feedback_type=irrelevant_answer) | [Incorrect Sources](https://app.dosu.dev/response-feedback/f48e393e-ce11-42a0-b2ab-403c65669698?feedback_type=incorrect_sources) | [Too Verbose](https://app.dosu.dev/response-feedback/f48e393e-ce11-42a0-b2ab-403c65669698?feedback_type=too_verbose) | [Hallucination](https://app.dosu.dev/response-feedback/f48e393e-ce11-42a0-b2ab-403c65669698?feedback_type=hallucination) | [Bug Report](https://app.dosu.dev/response-feedback/f48e393e-ce11-42a0-b2ab-403c65669698?feedback_type=bug_report) | [Other](https://app.dosu.dev/response-feedback/f48e393e-ce11-42a0-b2ab-403c65669698?feedback_type=other)</sup>
Author
Owner

@fdb02983rhy commented on GitHub (Mar 27, 2025):

Hi, what model are you using?

@fdb02983rhy commented on GitHub (Mar 27, 2025): Hi, what model are you using?
Author
Owner

@russch commented on GitHub (Mar 27, 2025):

@fdb02983rhy claude-3-5-sonnet-20241022

@russch commented on GitHub (Mar 27, 2025): @fdb02983rhy claude-3-5-sonnet-20241022
Author
Owner

@russch commented on GitHub (Mar 31, 2025):

FYI - I submitted https://github.com/langgenius/dify/issues/17080 shortly after this defect, and it has been resolved-fixed. I'm now finding I can continuously use both Tavilty and Perplexity without the Agent hanging. Can't be 100% sure the errors being thrown by .0.2 and .03 of the Perplexity tool were causing downstream issues in the agent, but there's correlation. Everything is good when I use .0.4 of the Perplexity tool.

If you're interested in keeping this open to understand why the Perplexity tool throwing exceptions might have caused the agent hang, feel free to investigate. But I am unblocked so as far as I'm concerned, this can be closed.

@russch commented on GitHub (Mar 31, 2025): FYI - I submitted https://github.com/langgenius/dify/issues/17080 shortly after this defect, and it has been resolved-fixed. I'm now finding I can continuously use both Tavilty and Perplexity **without** the Agent hanging. Can't be 100% sure the errors being thrown by .0.2 and .03 of the Perplexity tool were causing downstream issues in the agent, but there's correlation. Everything is good when I use .0.4 of the Perplexity tool. If you're interested in keeping this open to understand why the Perplexity tool throwing exceptions might have caused the agent hang, feel free to investigate. But I am unblocked so as far as I'm concerned, this can be closed.
Author
Owner

@russch commented on GitHub (Mar 31, 2025):

And I tried the Tavily Extract tool (new to me), it failed during the course of answering a prompt, and the very prompt also "hung" - so this isn't limited to Perplexity from what i can see.

@russch commented on GitHub (Mar 31, 2025): And I tried the Tavily Extract tool (new to me), it failed during the course of answering a prompt, and the very prompt also "hung" - so this isn't limited to Perplexity from what i can see.
Author
Owner

@fdb02983rhy commented on GitHub (Mar 31, 2025):

Cannot reproduce on my side. It will be helpful if you can provide some background logs.

Image Image Image Image
@fdb02983rhy commented on GitHub (Mar 31, 2025): Cannot reproduce on my side. It will be helpful if you can provide some background logs. <img width="602" alt="Image" src="https://github.com/user-attachments/assets/18fba7af-324f-4493-8506-f27e09280010" /> <img width="611" alt="Image" src="https://github.com/user-attachments/assets/5926d2d4-27f6-4e3c-9962-0ac65ff2bd8b" /> <img width="595" alt="Image" src="https://github.com/user-attachments/assets/ffa84b4c-3f94-4950-8cbc-dc71a686a5e3" /> <img width="595" alt="Image" src="https://github.com/user-attachments/assets/417504a6-f92e-4e04-9bc6-c7f8621af8c0" />
Author
Owner

@russch commented on GitHub (Apr 1, 2025):

@fdb02983rhy Happy to. What logs from which service?

@russch commented on GitHub (Apr 1, 2025): @fdb02983rhy Happy to. What logs from which service?
Author
Owner

@fdb02983rhy commented on GitHub (Apr 1, 2025):

@fdb02983rhy Happy to. What logs from which service?

Any errors when it hangs, can be frontend or backend(plugin daemon)

@fdb02983rhy commented on GitHub (Apr 1, 2025): > [@fdb02983rhy](https://github.com/fdb02983rhy) Happy to. What logs from which service? Any errors when it hangs, can be frontend or backend(plugin daemon)
Author
Owner

@russch commented on GitHub (Apr 1, 2025):

@fdb02983rhy

Image

daemon log is clean - all 200's.

nginx shows some 499s (I've never heard of these before):

2025-04-01T19:02:07.750317580Z 192.168.65.1 - - [01/Apr/2025:19:02:07 +0000] "GET /console/api/workspaces/current/default-model?model_type=text-embedding HTTP/1.1" 200 902 "http://192.168.0.102/app/43195d1e-8ad8-4d0b-936c-ffad777f0217/configuration" "Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:136.0) Gecko/20100101 Firefox/136.0" "-" 2025-04-01T19:02:07.763983965Z 192.168.65.1 - - [01/Apr/2025:19:02:07 +0000] "GET /console/api/workspaces/current/model-providers/langgenius/anthropic/anthropic/models/parameter-rules?model=claude-3-7-sonnet-20250219 HTTP/1.1" 200 4496 "http://192.168.0.102/app/43195d1e-8ad8-4d0b-936c-ffad777f0217/configuration" "Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:136.0) Gecko/20100101 Firefox/136.0" "-" 2025-04-01T19:02:18.857893128Z 192.168.65.1 - - [01/Apr/2025:19:02:18 +0000] "GET /tools?_rsc=obt3l HTTP/1.1" 200 161 "http://192.168.0.102/app/43195d1e-8ad8-4d0b-936c-ffad777f0217/configuration" "Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:136.0) Gecko/20100101 Firefox/136.0" "-" 2025-04-01T19:02:24.357424369Z 192.168.65.1 - - [01/Apr/2025:19:02:24 +0000] "GET /chat/PX6AoMExduIAfz6U HTTP/1.1" 200 6490 "-" "Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:136.0) Gecko/20100101 Firefox/136.0" "-" 2025-04-01T19:02:24.383722691Z 192.168.65.1 - - [01/Apr/2025:19:02:24 +0000] "GET /_next/static/chunks/1857-ff6ccc042182d3ce.js HTTP/1.1" 499 0 "http://192.168.0.102/chat/PX6AoMExduIAfz6U" "Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:136.0) Gecko/20100101 Firefox/136.0" "-" 2025-04-01T19:02:24.384389528Z 192.168.65.1 - - [01/Apr/2025:19:02:24 +0000] "GET /_next/static/chunks/273-3047e314ddc59bfe.js HTTP/1.1" 499 0 "http://192.168.0.102/chat/PX6AoMExduIAfz6U" "Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:136.0) Gecko/20100101 Firefox/136.0" "-" 2025-04-01T19:02:24.387098414Z 192.168.65.1 - - [01/Apr/2025:19:02:24 +0000] "GET /_next/static/chunks/6546-7395784e9bdf56f6.js HTTP/1.1" 499 0 "http://192.168.0.102/chat/PX6AoMExduIAfz6U" "Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:136.0) Gecko/20100101 Firefox/136.0" "-" 2025-04-01T19:02:24.387124407Z 192.168.65.1 - - [01/Apr/2025:19:02:24 +0000] "GET /_next/static/chunks/412-28750e9e2431d1cc.js HTTP/1.1" 499 0 "http://192.168.0.102/chat/PX6AoMExduIAfz6U" "Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:136.0) Gecko/20100101 Firefox/136.0" "-" 2025-04-01T19:02:24.387364274Z 192.168.65.1 - - [01/Apr/2025:19:02:24 +0000] "GET /_next/static/chunks/1114-8219d706fe53d0d6.js HTTP/1.1" 499 0 "http://192.168.0.102/chat/PX6AoMExduIAfz6U" "Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:136.0) Gecko/20100101 Firefox/136.0" "-" 2025-04-01T19:02:24.387375559Z 192.168.65.1 - - [01/Apr/2025:19:02:24 +0000] "GET /_next/static/chunks/7073-3f890c9cdc342d8f.js HTTP/1.1" 499 0 "http://192.168.0.102/chat/PX6AoMExduIAfz6U" "Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:136.0) Gecko/20100101 Firefox/136.0" "-" 2025-04-01T19:02:24.623250114Z 192.168.65.1 - - [01/Apr/2025:19:02:24 +0000] "GET /api/meta HTTP/1.1" 200 420 "http://192.168.0.102/chat/PX6AoMExduIAfz6U" "Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:136.0) Gecko/20100101 Firefox/136.0" "-" 2025-04-01T19:02:24.623684643Z 192.168.65.1 - - [01/Apr/2025:19:02:24 +0000] "GET /api/parameters HTTP/1.1" 200 980 "http://192.168.0.102/chat/PX6AoMExduIAfz6U" "Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:136.0) Gecko/20100101 Firefox/136.0" "-" 2025-04-01T19:02:24.628942997Z 192.168.65.1 - - [01/Apr/2025:19:02:24 +0000] "GET /api/conversations?limit=100&pinned=true HTTP/1.1" 200 46 "http://192.168.0.102/chat/PX6AoMExduIAfz6U" "Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:136.0) Gecko/20100101 Firefox/136.0" "-" 2025-04-01T19:02:24.629356316Z 192.168.65.1 - - [01/Apr/2025:19:02:24 +0000] "GET /api/site HTTP/1.1" 200 611 "http://192.168.0.102/chat/PX6AoMExduIAfz6U" "Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:136.0) Gecko/20100101 Firefox/136.0" "-" 2025-04-01T19:02:24.630271225Z 192.168.65.1 - - [01/Apr/2025:19:02:24 +0000] "GET /api/conversations?limit=100&pinned=false HTTP/1.1" 200 46 "http://192.168.0.102/chat/PX6AoMExduIAfz6U" "Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:136.0) Gecko/20100101 Firefox/136.0" "-" 2025-04-01T19:02:24.669043512Z 192.168.65.1 - - [01/Apr/2025:19:02:24 +0000] "GET /logo/logo.png HTTP/1.1" 200 6249 "http://192.168.0.102/chat/PX6AoMExduIAfz6U" "Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:136.0) Gecko/20100101 Firefox/136.0" "-" 2025-04-01T19:02:24.681262193Z 192.168.65.1 - - [01/Apr/2025:19:02:24 +0000] "GET /api/meta HTTP/1.1" 200 420 "http://192.168.0.102/chat/PX6AoMExduIAfz6U" "Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:136.0) Gecko/20100101 Firefox/136.0" "-" 2025-04-01T19:02:24.682431451Z 192.168.65.1 - - [01/Apr/2025:19:02:24 +0000] "GET /api/parameters HTTP/1.1" 200 980 "http://192.168.0.102/chat/PX6AoMExduIAfz6U" "Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:136.0) Gecko/20100101 Firefox/136.0" "-"

API service shows some exceptions:
2025-04-01T19:02:54.728664715Z 2025-04-01 19:02:54.728 INFO [Thread-87 (_generate_worker)] [_client.py:1038] - HTTP Request: HEAD https://docs.dify.ai/guides/workflow/additional-features "HTTP/1.1 200 OK" 2025-04-01T19:02:55.197771962Z 2025-04-01 19:02:55.197 INFO [Thread-87 (_generate_worker)] [_client.py:1038] - HTTP Request: GET https://docs.dify.ai/guides/workflow/additional-features "HTTP/1.1 200 OK" 2025-04-01T19:03:55.538044474Z 2025-04-01 19:03:55.536 ERROR [Thread-94 (_generate_worker)] [app_generator.py:260] - Unknown Error when generating 2025-04-01T19:03:55.538060029Z Traceback (most recent call last): 2025-04-01T19:03:55.538064346Z File "/app/api/core/app/apps/agent_chat/app_generator.py", line 240, in _generate_worker 2025-04-01T19:03:55.538067072Z runner.run( 2025-04-01T19:03:55.538069474Z File "/app/api/core/app/apps/agent_chat/app_runner.py", line 245, in run 2025-04-01T19:03:55.538071788Z self._handle_invoke_result( 2025-04-01T19:03:55.538073989Z File "/app/api/core/app/apps/base_app_runner.py", line 278, in _handle_invoke_result 2025-04-01T19:03:55.538076346Z self._handle_invoke_result_stream(invoke_result=invoke_result, queue_manager=queue_manager, agent=agent) 2025-04-01T19:03:55.538078679Z File "/app/api/core/app/apps/base_app_runner.py", line 313, in _handle_invoke_result_stream 2025-04-01T19:03:55.538080971Z for result in invoke_result: 2025-04-01T19:03:55.538083181Z ^^^^^^^^^^^^^ 2025-04-01T19:03:55.538085349Z File "/app/api/core/agent/fc_agent_runner.py", line 89, in run 2025-04-01T19:03:55.538087609Z self.recalc_llm_max_tokens(self.model_config, prompt_messages) 2025-04-01T19:03:55.538089824Z File "/app/api/core/app/apps/base_app_runner.py", line 127, in recalc_llm_max_tokens 2025-04-01T19:03:55.538092116Z prompt_tokens = model_instance.get_llm_num_tokens(prompt_messages) 2025-04-01T19:03:55.538094346Z ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 2025-04-01T19:03:55.538096567Z File "/app/api/core/model_manager.py", line 195, in get_llm_num_tokens 2025-04-01T19:03:55.538098849Z self._round_robin_invoke( 2025-04-01T19:03:55.538101063Z File "/app/api/core/model_manager.py", line 370, in _round_robin_invoke 2025-04-01T19:03:55.538104838Z return function(*args, **kwargs) 2025-04-01T19:03:55.538107049Z ^^^^^^^^^^^^^^^^^^^^^^^^^ 2025-04-01T19:03:55.538109229Z File "/app/api/core/model_runtime/model_providers/__base/large_language_model.py", line 299, in get_num_tokens 2025-04-01T19:03:55.538111572Z return plugin_model_manager.get_llm_num_tokens( 2025-04-01T19:03:55.538113770Z ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 2025-04-01T19:03:55.538121685Z File "/app/api/core/plugin/manager/model.py", line 231, in get_llm_num_tokens 2025-04-01T19:03:55.538123696Z for resp in response: 2025-04-01T19:03:55.538125771Z ^^^^^^^^ 2025-04-01T19:03:55.538127374Z File "/app/api/core/plugin/manager/base.py", line 189, in _request_with_plugin_daemon_response_stream 2025-04-01T19:03:55.538129090Z self._handle_plugin_daemon_error(error.error_type, error.message) 2025-04-01T19:03:55.538130739Z File "/app/api/core/plugin/manager/base.py", line 221, in _handle_plugin_daemon_error 2025-04-01T19:03:55.538132394Z raise PluginInvokeError(description=message) 2025-04-01T19:03:55.538134489Z core.plugin.manager.exc.PluginInvokeError: PluginInvokeError: {"args":{},"error_type":"BadRequestError","message":"Error code: 400 - {'type': 'error', 'error': {'type': 'invalid_request_error', 'message': 'messages.11: all messages must have non-empty content except for the optional final assistant message'}}"} 2025-04-01T19:03:55.542342332Z 2025-04-01 19:03:55.541 ERROR [Dummy-95] [base_app_generate_response_converter.py:123] - {"args":{},"error_type":"BadRequestError","message":"Error code: 400 - {'type': 'error', 'error': {'type': 'invalid_request_error', 'message': 'messages.11: all messages must have non-empty content except for the optional final assistant message'}}"}

@russch commented on GitHub (Apr 1, 2025): @fdb02983rhy <img width="1559" alt="Image" src="https://github.com/user-attachments/assets/f2ed591f-4277-49c9-9cee-c532e90ced22" /> **daemon** log is clean - all 200's. **nginx** shows some 499s (I've never heard of these before): `2025-04-01T19:02:07.750317580Z 192.168.65.1 - - [01/Apr/2025:19:02:07 +0000] "GET /console/api/workspaces/current/default-model?model_type=text-embedding HTTP/1.1" 200 902 "http://192.168.0.102/app/43195d1e-8ad8-4d0b-936c-ffad777f0217/configuration" "Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:136.0) Gecko/20100101 Firefox/136.0" "-" 2025-04-01T19:02:07.763983965Z 192.168.65.1 - - [01/Apr/2025:19:02:07 +0000] "GET /console/api/workspaces/current/model-providers/langgenius/anthropic/anthropic/models/parameter-rules?model=claude-3-7-sonnet-20250219 HTTP/1.1" 200 4496 "http://192.168.0.102/app/43195d1e-8ad8-4d0b-936c-ffad777f0217/configuration" "Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:136.0) Gecko/20100101 Firefox/136.0" "-" 2025-04-01T19:02:18.857893128Z 192.168.65.1 - - [01/Apr/2025:19:02:18 +0000] "GET /tools?_rsc=obt3l HTTP/1.1" 200 161 "http://192.168.0.102/app/43195d1e-8ad8-4d0b-936c-ffad777f0217/configuration" "Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:136.0) Gecko/20100101 Firefox/136.0" "-" 2025-04-01T19:02:24.357424369Z 192.168.65.1 - - [01/Apr/2025:19:02:24 +0000] "GET /chat/PX6AoMExduIAfz6U HTTP/1.1" 200 6490 "-" "Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:136.0) Gecko/20100101 Firefox/136.0" "-" 2025-04-01T19:02:24.383722691Z 192.168.65.1 - - [01/Apr/2025:19:02:24 +0000] "GET /_next/static/chunks/1857-ff6ccc042182d3ce.js HTTP/1.1" 499 0 "http://192.168.0.102/chat/PX6AoMExduIAfz6U" "Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:136.0) Gecko/20100101 Firefox/136.0" "-" 2025-04-01T19:02:24.384389528Z 192.168.65.1 - - [01/Apr/2025:19:02:24 +0000] "GET /_next/static/chunks/273-3047e314ddc59bfe.js HTTP/1.1" 499 0 "http://192.168.0.102/chat/PX6AoMExduIAfz6U" "Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:136.0) Gecko/20100101 Firefox/136.0" "-" 2025-04-01T19:02:24.387098414Z 192.168.65.1 - - [01/Apr/2025:19:02:24 +0000] "GET /_next/static/chunks/6546-7395784e9bdf56f6.js HTTP/1.1" 499 0 "http://192.168.0.102/chat/PX6AoMExduIAfz6U" "Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:136.0) Gecko/20100101 Firefox/136.0" "-" 2025-04-01T19:02:24.387124407Z 192.168.65.1 - - [01/Apr/2025:19:02:24 +0000] "GET /_next/static/chunks/412-28750e9e2431d1cc.js HTTP/1.1" 499 0 "http://192.168.0.102/chat/PX6AoMExduIAfz6U" "Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:136.0) Gecko/20100101 Firefox/136.0" "-" 2025-04-01T19:02:24.387364274Z 192.168.65.1 - - [01/Apr/2025:19:02:24 +0000] "GET /_next/static/chunks/1114-8219d706fe53d0d6.js HTTP/1.1" 499 0 "http://192.168.0.102/chat/PX6AoMExduIAfz6U" "Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:136.0) Gecko/20100101 Firefox/136.0" "-" 2025-04-01T19:02:24.387375559Z 192.168.65.1 - - [01/Apr/2025:19:02:24 +0000] "GET /_next/static/chunks/7073-3f890c9cdc342d8f.js HTTP/1.1" 499 0 "http://192.168.0.102/chat/PX6AoMExduIAfz6U" "Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:136.0) Gecko/20100101 Firefox/136.0" "-" 2025-04-01T19:02:24.623250114Z 192.168.65.1 - - [01/Apr/2025:19:02:24 +0000] "GET /api/meta HTTP/1.1" 200 420 "http://192.168.0.102/chat/PX6AoMExduIAfz6U" "Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:136.0) Gecko/20100101 Firefox/136.0" "-" 2025-04-01T19:02:24.623684643Z 192.168.65.1 - - [01/Apr/2025:19:02:24 +0000] "GET /api/parameters HTTP/1.1" 200 980 "http://192.168.0.102/chat/PX6AoMExduIAfz6U" "Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:136.0) Gecko/20100101 Firefox/136.0" "-" 2025-04-01T19:02:24.628942997Z 192.168.65.1 - - [01/Apr/2025:19:02:24 +0000] "GET /api/conversations?limit=100&pinned=true HTTP/1.1" 200 46 "http://192.168.0.102/chat/PX6AoMExduIAfz6U" "Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:136.0) Gecko/20100101 Firefox/136.0" "-" 2025-04-01T19:02:24.629356316Z 192.168.65.1 - - [01/Apr/2025:19:02:24 +0000] "GET /api/site HTTP/1.1" 200 611 "http://192.168.0.102/chat/PX6AoMExduIAfz6U" "Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:136.0) Gecko/20100101 Firefox/136.0" "-" 2025-04-01T19:02:24.630271225Z 192.168.65.1 - - [01/Apr/2025:19:02:24 +0000] "GET /api/conversations?limit=100&pinned=false HTTP/1.1" 200 46 "http://192.168.0.102/chat/PX6AoMExduIAfz6U" "Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:136.0) Gecko/20100101 Firefox/136.0" "-" 2025-04-01T19:02:24.669043512Z 192.168.65.1 - - [01/Apr/2025:19:02:24 +0000] "GET /logo/logo.png HTTP/1.1" 200 6249 "http://192.168.0.102/chat/PX6AoMExduIAfz6U" "Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:136.0) Gecko/20100101 Firefox/136.0" "-" 2025-04-01T19:02:24.681262193Z 192.168.65.1 - - [01/Apr/2025:19:02:24 +0000] "GET /api/meta HTTP/1.1" 200 420 "http://192.168.0.102/chat/PX6AoMExduIAfz6U" "Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:136.0) Gecko/20100101 Firefox/136.0" "-" 2025-04-01T19:02:24.682431451Z 192.168.65.1 - - [01/Apr/2025:19:02:24 +0000] "GET /api/parameters HTTP/1.1" 200 980 "http://192.168.0.102/chat/PX6AoMExduIAfz6U" "Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:136.0) Gecko/20100101 Firefox/136.0" "-"` **API service** shows some exceptions: `2025-04-01T19:02:54.728664715Z 2025-04-01 19:02:54.728 INFO [Thread-87 (_generate_worker)] [_client.py:1038] - HTTP Request: HEAD https://docs.dify.ai/guides/workflow/additional-features "HTTP/1.1 200 OK" 2025-04-01T19:02:55.197771962Z 2025-04-01 19:02:55.197 INFO [Thread-87 (_generate_worker)] [_client.py:1038] - HTTP Request: GET https://docs.dify.ai/guides/workflow/additional-features "HTTP/1.1 200 OK" 2025-04-01T19:03:55.538044474Z 2025-04-01 19:03:55.536 ERROR [Thread-94 (_generate_worker)] [app_generator.py:260] - Unknown Error when generating 2025-04-01T19:03:55.538060029Z Traceback (most recent call last): 2025-04-01T19:03:55.538064346Z File "/app/api/core/app/apps/agent_chat/app_generator.py", line 240, in _generate_worker 2025-04-01T19:03:55.538067072Z runner.run( 2025-04-01T19:03:55.538069474Z File "/app/api/core/app/apps/agent_chat/app_runner.py", line 245, in run 2025-04-01T19:03:55.538071788Z self._handle_invoke_result( 2025-04-01T19:03:55.538073989Z File "/app/api/core/app/apps/base_app_runner.py", line 278, in _handle_invoke_result 2025-04-01T19:03:55.538076346Z self._handle_invoke_result_stream(invoke_result=invoke_result, queue_manager=queue_manager, agent=agent) 2025-04-01T19:03:55.538078679Z File "/app/api/core/app/apps/base_app_runner.py", line 313, in _handle_invoke_result_stream 2025-04-01T19:03:55.538080971Z for result in invoke_result: 2025-04-01T19:03:55.538083181Z ^^^^^^^^^^^^^ 2025-04-01T19:03:55.538085349Z File "/app/api/core/agent/fc_agent_runner.py", line 89, in run 2025-04-01T19:03:55.538087609Z self.recalc_llm_max_tokens(self.model_config, prompt_messages) 2025-04-01T19:03:55.538089824Z File "/app/api/core/app/apps/base_app_runner.py", line 127, in recalc_llm_max_tokens 2025-04-01T19:03:55.538092116Z prompt_tokens = model_instance.get_llm_num_tokens(prompt_messages) 2025-04-01T19:03:55.538094346Z ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 2025-04-01T19:03:55.538096567Z File "/app/api/core/model_manager.py", line 195, in get_llm_num_tokens 2025-04-01T19:03:55.538098849Z self._round_robin_invoke( 2025-04-01T19:03:55.538101063Z File "/app/api/core/model_manager.py", line 370, in _round_robin_invoke 2025-04-01T19:03:55.538104838Z return function(*args, **kwargs) 2025-04-01T19:03:55.538107049Z ^^^^^^^^^^^^^^^^^^^^^^^^^ 2025-04-01T19:03:55.538109229Z File "/app/api/core/model_runtime/model_providers/__base/large_language_model.py", line 299, in get_num_tokens 2025-04-01T19:03:55.538111572Z return plugin_model_manager.get_llm_num_tokens( 2025-04-01T19:03:55.538113770Z ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 2025-04-01T19:03:55.538121685Z File "/app/api/core/plugin/manager/model.py", line 231, in get_llm_num_tokens 2025-04-01T19:03:55.538123696Z for resp in response: 2025-04-01T19:03:55.538125771Z ^^^^^^^^ 2025-04-01T19:03:55.538127374Z File "/app/api/core/plugin/manager/base.py", line 189, in _request_with_plugin_daemon_response_stream 2025-04-01T19:03:55.538129090Z self._handle_plugin_daemon_error(error.error_type, error.message) 2025-04-01T19:03:55.538130739Z File "/app/api/core/plugin/manager/base.py", line 221, in _handle_plugin_daemon_error 2025-04-01T19:03:55.538132394Z raise PluginInvokeError(description=message) 2025-04-01T19:03:55.538134489Z core.plugin.manager.exc.PluginInvokeError: PluginInvokeError: {"args":{},"error_type":"BadRequestError","message":"Error code: 400 - {'type': 'error', 'error': {'type': 'invalid_request_error', 'message': 'messages.11: all messages must have non-empty content except for the optional final assistant message'}}"} 2025-04-01T19:03:55.542342332Z 2025-04-01 19:03:55.541 ERROR [Dummy-95] [base_app_generate_response_converter.py:123] - {"args":{},"error_type":"BadRequestError","message":"Error code: 400 - {'type': 'error', 'error': {'type': 'invalid_request_error', 'message': 'messages.11: all messages must have non-empty content except for the optional final assistant message'}}"} `
Author
Owner

@fdb02983rhy commented on GitHub (Apr 1, 2025):

I can see It hits the maximum iteration from the screenshot, try to ask Claude do not use tools more than 5 times.

@fdb02983rhy commented on GitHub (Apr 1, 2025): I can see It hits the maximum iteration from the screenshot, try to ask Claude do not use tools more than 5 times.
Author
Owner

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

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

Issue Summary:

  • The Dify Agent became unresponsive after using external tools in a self-hosted Docker environment with version 1.13.
  • You resolved the issue by updating the Perplexity tool to version 0.4, but noted similar issues with the Tavily Extract tool.
  • Limiting tool usage to no more than five times was suggested to prevent the agent from hanging.

Next Steps:

  • Please let me know if this issue is still relevant to the latest version of the Dify repository by commenting here.
  • If no updates are provided, this issue will be automatically closed in 15 days.

Thank you for your understanding and contribution!

@dosubot[bot] commented on GitHub (May 3, 2025): Hi, @russch. I'm [Dosu](https://dosu.dev), and I'm helping the Dify team manage their backlog. I'm marking this issue as stale. **Issue Summary:** - The Dify Agent became unresponsive after using external tools in a self-hosted Docker environment with version 1.13. - You resolved the issue by updating the Perplexity tool to version 0.4, but noted similar issues with the Tavily Extract tool. - Limiting tool usage to no more than five times was suggested to prevent the agent from hanging. **Next Steps:** - Please let me know if this issue is still relevant to the latest version of the Dify repository by commenting here. - If no updates are provided, this issue will be automatically closed 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#12250