Tool Response is empty in Agent node if response too long ( > 68000 ) #13322

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

Originally created by @EcoleKeine on GitHub (Apr 24, 2025).

Originally assigned to: @Nov1c444 on GitHub.

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

Cloud or Self Hosted

Self Hosted (Docker)

Steps to reproduce

  1. create tool workflow long_text_creator
    return code node result:
def main() -> dict:
    return {
        "result": "1234567890" * 6800,
    }
  1. create chatflow, add agent, make agent use long_text_creator tool
    add long_text_creator tool node for compare

✔️ Expected Behavior

LLM agent call long_text_creator tool and get long text

Actual Behavior

Agent node function call result:

{
  "output": {
    "tool_call_id": "long_text_creator",
    "tool_call_input": {},
    "tool_call_name": "long_text_creator",
    "tool_response": ""
  }
}

Tool Node result is ok

Originally created by @EcoleKeine on GitHub (Apr 24, 2025). Originally assigned to: @Nov1c444 on GitHub. ### 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.3.0 ### Cloud or Self Hosted Self Hosted (Docker) ### Steps to reproduce 1. create tool workflow `long_text_creator` return code node result: ```python def main() -> dict: return { "result": "1234567890" * 6800, } ``` 2. create chatflow, add agent, make agent use `long_text_creator` tool add `long_text_creator` tool node for compare ### ✔️ Expected Behavior LLM agent call `long_text_creator` tool and get long text ### ❌ Actual Behavior Agent node function call result: ```json { "output": { "tool_call_id": "long_text_creator", "tool_call_input": {}, "tool_call_name": "long_text_creator", "tool_response": "" } } ``` Tool Node result is ok
yindo added the 🐞 bug label 2026-02-21 19:11:38 -05:00
yindo closed this issue 2026-02-21 19:11:38 -05:00
Author
Owner

@dosubot[bot] commented on GitHub (Apr 24, 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 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.

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 (Apr 24, 2025): <!-- Answer --> 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 <sup>[[1]](https://github.com/langgenius/dify/blob/main/api/core/workflow/nodes/http_request/executor.py)</sup>. 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 <sup>[[2]](https://github.com/langgenius/dify/blob/main/docker/docker-compose.yaml)</sup>. 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 <sup>[[3]](https://github.com/langgenius/dify-docs/blob/main/jp/getting-started/install-self-hosted/environments.md)</sup>. Make sure to restart your Docker containers after making these changes to apply the new configuration. <!-- 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/d308ea7d-f1d0-4c37-8bb7-9bfb4ede1750?feedback_type=great_response) | [Irrelevant Answer](https://app.dosu.dev/response-feedback/d308ea7d-f1d0-4c37-8bb7-9bfb4ede1750?feedback_type=irrelevant_answer) | [Incorrect Sources](https://app.dosu.dev/response-feedback/d308ea7d-f1d0-4c37-8bb7-9bfb4ede1750?feedback_type=incorrect_sources) | [Too Verbose](https://app.dosu.dev/response-feedback/d308ea7d-f1d0-4c37-8bb7-9bfb4ede1750?feedback_type=too_verbose) | [Hallucination](https://app.dosu.dev/response-feedback/d308ea7d-f1d0-4c37-8bb7-9bfb4ede1750?feedback_type=hallucination) | [Bug Report](https://app.dosu.dev/response-feedback/d308ea7d-f1d0-4c37-8bb7-9bfb4ede1750?feedback_type=bug_report) | [Other](https://app.dosu.dev/response-feedback/d308ea7d-f1d0-4c37-8bb7-9bfb4ede1750?feedback_type=other)</sup>
Author
Owner

@crazywoola commented on GitHub (Apr 24, 2025):

Have you changed these?

https://github.com/langgenius/dify/blob/37e2f739091169eecc7c446d8232915bdaf6f895/docker/.env.example#L739-L752

@crazywoola commented on GitHub (Apr 24, 2025): Have you changed these? https://github.com/langgenius/dify/blob/37e2f739091169eecc7c446d8232915bdaf6f895/docker/.env.example#L739-L752
Author
Owner

@EcoleKeine commented on GitHub (Apr 24, 2025):

@crazywoola

those are changed:
CODE_MAX_STRING_ARRAY_LENGTH=300
CODE_MAX_OBJECT_ARRAY_LENGTH=300
CODE_EXECUTION_READ_TIMEOUT=360

my .env:

# The sandbox service endpoint.
CODE_EXECUTION_ENDPOINT=http://sandbox:8194
CODE_EXECUTION_API_KEY=dify-sandbox
CODE_MAX_NUMBER=9223372036854775807
CODE_MIN_NUMBER=-9223372036854775808
CODE_MAX_DEPTH=5
CODE_MAX_PRECISION=20
CODE_MAX_STRING_LENGTH=80000
CODE_MAX_STRING_ARRAY_LENGTH=300
CODE_MAX_OBJECT_ARRAY_LENGTH=300
CODE_MAX_NUMBER_ARRAY_LENGTH=1000
CODE_EXECUTION_CONNECT_TIMEOUT=10
CODE_EXECUTION_READ_TIMEOUT=360
CODE_EXECUTION_WRITE_TIMEOUT=10
TEMPLATE_TRANSFORM_MAX_LENGTH=80000
@EcoleKeine commented on GitHub (Apr 24, 2025): @crazywoola those are changed: CODE_MAX_STRING_ARRAY_LENGTH=300 CODE_MAX_OBJECT_ARRAY_LENGTH=300 CODE_EXECUTION_READ_TIMEOUT=360 my .env: ```ini # The sandbox service endpoint. CODE_EXECUTION_ENDPOINT=http://sandbox:8194 CODE_EXECUTION_API_KEY=dify-sandbox CODE_MAX_NUMBER=9223372036854775807 CODE_MIN_NUMBER=-9223372036854775808 CODE_MAX_DEPTH=5 CODE_MAX_PRECISION=20 CODE_MAX_STRING_LENGTH=80000 CODE_MAX_STRING_ARRAY_LENGTH=300 CODE_MAX_OBJECT_ARRAY_LENGTH=300 CODE_MAX_NUMBER_ARRAY_LENGTH=1000 CODE_EXECUTION_CONNECT_TIMEOUT=10 CODE_EXECUTION_READ_TIMEOUT=360 CODE_EXECUTION_WRITE_TIMEOUT=10 TEMPLATE_TRANSFORM_MAX_LENGTH=80000 ```
Author
Owner

@crazywoola commented on GitHub (Apr 24, 2025):

Image

I have tried, it seems working as expected.

@crazywoola commented on GitHub (Apr 24, 2025): <img width="1331" alt="Image" src="https://github.com/user-attachments/assets/edc5dbc5-d247-4f1b-9f26-1b28bf9ca7af" /> I have tried, it seems working as expected.
Author
Owner

@crazywoola commented on GitHub (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

@crazywoola commented on GitHub (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
Author
Owner

@EcoleKeine commented on GitHub (Apr 25, 2025):

@crazywoola

I have tried, it seems working as expected.

Only call by Agent Node will return empty
Tool Node working as expected

@EcoleKeine commented on GitHub (Apr 25, 2025): @crazywoola > I have tried, it seems working as expected. Only call by **Agent Node** will return empty Tool Node working as expected
Author
Owner

@Nov1c444 commented on GitHub (Apr 27, 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.

Image

@Nov1c444 commented on GitHub (Apr 27, 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. ![Image](https://github.com/user-attachments/assets/82bd01a6-826f-408c-b536-26fd63cff8a8)
Author
Owner

@Nov1c444 commented on GitHub (May 12, 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.

Image
@Nov1c444 commented on GitHub (May 12, 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. <img width="968" alt="Image" src="https://github.com/user-attachments/assets/b3f54a57-4d71-423d-95be-9d945151ea9f" />
Author
Owner

@homeant commented on GitHub (May 21, 2025):

Has anyone resolved this issue? I’d really appreciate some guidance.

@homeant commented on GitHub (May 21, 2025): Has anyone resolved this issue? I’d really appreciate some guidance.
Author
Owner

@zhudongwork commented on GitHub (Jul 1, 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.

Image

@zhudongwork commented on GitHub (Jul 1, 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. ![Image](https://github.com/user-attachments/assets/47ecbd76-08b9-4d5d-8f46-28b8d7e0e1a0)
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: langgenius/dify#13322