You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Tool Response is empty in Agent node if response too long ( > 68000 ) #18731
The issue you're experiencing with the Agent node not handling long tool responses correctly might be related to the maximum payload size settings in Dify. The Agent node raises a ResponseSizeError if the response size exceeds the defined threshold, which could be causing the empty response you're seeing [1].
To address this, you can adjust the MAX_VARIABLE_SIZE setting in your docker/docker-compose.yaml file to handle larger responses. The default value is 204800, and increasing this value might help accommodate longer responses [2]. Additionally, check the HTTP_REQUEST_NODE_MAX_TEXT_SIZE setting, which defaults to 1MB, and increase it if necessary to ensure it can handle the size of your tool's response [3].
Make sure to restart your Docker containers after making these changes to apply the new configuration.
After my investigation, I found that the reason the tool results cannot be returned here is because the default size of the scanner in Go is 64k. When exceeding this size, it will skip the content. We can support larger response by increasing this limit, but we're still discussing exactly how large the adjustment should be.
Reacted by quicksand, Kevin9703, EcoleKeine, Allen and syed-shah-zepto
Now you can increase the byte transmission limit by configuring the two env parameters PLUGIN_STDIO_BUFFER_SIZE and PLUGIN_STDIO_MAX_BUFFER_SIZE in the dify-plugin-daemon service.
But when the input is long(~60k), the agent node returns an empty output after running for a few seconds. Is there a timeout setting causing this? With the same input, the LLM node can start generating output after waiting around 10 seconds.
Activity
dosubot commentedon Apr 25, 2025
The issue you're experiencing with the Agent node not handling long tool responses correctly might be related to the maximum payload size settings in Dify. The Agent node raises a
ResponseSizeErrorif the response size exceeds the defined threshold, which could be causing the empty response you're seeing [1].To address this, you can adjust the
MAX_VARIABLE_SIZEsetting in yourdocker/docker-compose.yamlfile to handle larger responses. The default value is 204800, and increasing this value might help accommodate longer responses [2]. Additionally, check theHTTP_REQUEST_NODE_MAX_TEXT_SIZEsetting, which defaults to 1MB, and increase it if necessary to ensure it can handle the size of your tool's response [3].Make sure to restart your Docker containers after making these changes to apply the new configuration.
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
crazywoola commentedon Apr 25, 2025
Have you changed these?
dify/docker/.env.example
Lines 739 to 752 in 37e2f73
EcoleKeine commentedon Apr 25, 2025
@crazywoola
those are changed:
CODE_MAX_STRING_ARRAY_LENGTH=300
CODE_MAX_OBJECT_ARRAY_LENGTH=300
CODE_EXECUTION_READ_TIMEOUT=360
my .env:
crazywoola commentedon Apr 25, 2025
I have tried, it seems working as expected.
crazywoola commentedon Apr 25, 2025
If the LLM still generates the results, then it means the connection with plugin_daemon is normal. Maybe it's a frontend limitation.
https://github.com/langgenius/dify/blob/44cdb3dceaf6414d3ca3e5fd864fed4ed1e335fa/web/service/base.ts
EcoleKeine commentedon Apr 25, 2025
@crazywoola
Only call by Agent Node will return empty
Tool Node working as expected
Nov1c444 commentedon Apr 28, 2025
After my investigation, I found that the reason the tool results cannot be returned here is because the default size of the scanner in Go is 64k. When exceeding this size, it will skip the content. We can support larger response by increasing this limit, but we're still discussing exactly how large the adjustment should be.
Nov1c444 commentedon May 13, 2025
Now you can increase the byte transmission limit by configuring the two env parameters PLUGIN_STDIO_BUFFER_SIZE and PLUGIN_STDIO_MAX_BUFFER_SIZE in the dify-plugin-daemon service.
homeant commentedon May 21, 2025
Has anyone resolved this issue? I’d really appreciate some guidance.
zhudongwork commentedon Jul 2, 2025
But when the input is long(~60k), the agent node returns an empty output after running for a few seconds. Is there a timeout setting causing this? With the same input, the LLM node can start generating output after waiting around 10 seconds.