CHATFLOW #13518

Closed
opened 2026-02-21 19:12:31 -05:00 by yindo · 2 comments
Owner

Originally created by @SharkByte-Pray on GitHub (Apr 29, 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.3.1

Cloud or Self Hosted

Self Hosted (Docker)

Steps to reproduce

The upload document function I used in the chatflow workflow uploaded the same file with a size of 1.31M during testing.

✔️ Expected Behavior

At the beginning, it could operate normally and output normally.

Actual Behavior

But when testing again today, an error occurred: Run failed: [deepseek] Error: PluginInvokeError: {"args":{"description":"[models] Error: API request failed with status code 400: {"error":{"message":"This model's maximum context length is 65536 tokens. However, you requested 76651 tokens (76651 in the messages, 0 in the completion). Please reduce the length of the messages or completion.","type":"invalid_request_error","param":null,"code":"invalid_request_error"}}"},"error_type":"InvokeError", "message":"[models] Error: API request failed with status code 400: {"error":{"message":"This model's maximum context length is 65536 tokens. However, you requested 76651 tokens (76651 in the messages, 0 in the completion). Please reduce the length of the messages or completion.","type":"invalid_request_error","param":null,"code":"invalid_request_error"}}"}
I didn't turn on the memory function, and I uploaded the same file. What's the reason for this

Image

Originally created by @SharkByte-Pray on GitHub (Apr 29, 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.3.1 ### Cloud or Self Hosted Self Hosted (Docker) ### Steps to reproduce The upload document function I used in the chatflow workflow uploaded the same file with a size of 1.31M during testing. ### ✔️ Expected Behavior At the beginning, it could operate normally and output normally. ### ❌ Actual Behavior But when testing again today, an error occurred: Run failed: [deepseek] Error: PluginInvokeError: {"args":{"description":"[models] Error: API request failed with status code 400: {"error":{"message":"This model's maximum context length is 65536 tokens. However, you requested 76651 tokens (76651 in the messages, 0 in the completion). Please reduce the length of the messages or completion.","type":"invalid_request_error","param":null,"code":"invalid_request_error"}}"},"error_type":"InvokeError", "message":"[models] Error: API request failed with status code 400: {"error":{"message":"This model's maximum context length is 65536 tokens. However, you requested 76651 tokens (76651 in the messages, 0 in the completion). Please reduce the length of the messages or completion.","type":"invalid_request_error","param":null,"code":"invalid_request_error"}}"} I didn't turn on the memory function, and I uploaded the same file. What's the reason for this ![Image](https://github.com/user-attachments/assets/037534cb-a231-4c94-be81-d118c8cede0a)
yindo closed this issue 2026-02-21 19:12:31 -05:00
Author
Owner

@dosubot[bot] commented on GitHub (Apr 29, 2025):

I found a similar unsolved discussion titled Error:Query or prefix prompt is too long which might be related to your issue [1]. Additionally, there is an open issue titled Run faild: [openai] Bad Request Error, Error code: 400 - 'max_tokens' is not supported with this model that was closed by a pull request addressing a similar error [2].

Regarding your issue, the error message indicates that the request exceeded the model's maximum context length of 65,536 tokens. This can happen if the combined length of the messages and the completion request exceeds this limit. To resolve this, you may need to reduce the length of the messages or the completion request.

If you haven't already, check if there are any settings or configurations in your Dify setup that might allow you to manage or adjust the token limits. Additionally, ensure that the document being uploaded is processed correctly to avoid unnecessary token usage.

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 29, 2025): <!-- Answer --> I found a similar unsolved discussion titled [Error:Query or prefix prompt is too long](https://github.com/langgenius/dify/discussions/14852) which might be related to your issue <sup>[[1]](https://github.com/langgenius/dify/discussions/14852)</sup>. Additionally, there is an open issue titled [Run faild: [openai] Bad Request Error, Error code: 400 - 'max_tokens' is not supported with this model](https://github.com/langgenius/dify/issues/13242) that was closed by a pull request addressing a similar error <sup>[[2]](https://github.com/langgenius/dify/issues/13242)</sup>. Regarding your issue, the error message indicates that the request exceeded the model's maximum context length of 65,536 tokens. This can happen if the combined length of the messages and the completion request exceeds this limit. To resolve this, you may need to reduce the length of the messages or the completion request. If you haven't already, check if there are any settings or configurations in your Dify setup that might allow you to manage or adjust the token limits. Additionally, ensure that the document being uploaded is processed correctly to avoid unnecessary token usage. <!-- 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/27bde6ae-e161-486e-9d55-48b1ffacd6be?feedback_type=great_response) | [Irrelevant Answer](https://app.dosu.dev/response-feedback/27bde6ae-e161-486e-9d55-48b1ffacd6be?feedback_type=irrelevant_answer) | [Incorrect Sources](https://app.dosu.dev/response-feedback/27bde6ae-e161-486e-9d55-48b1ffacd6be?feedback_type=incorrect_sources) | [Too Verbose](https://app.dosu.dev/response-feedback/27bde6ae-e161-486e-9d55-48b1ffacd6be?feedback_type=too_verbose) | [Hallucination](https://app.dosu.dev/response-feedback/27bde6ae-e161-486e-9d55-48b1ffacd6be?feedback_type=hallucination) | [Bug Report](https://app.dosu.dev/response-feedback/27bde6ae-e161-486e-9d55-48b1ffacd6be?feedback_type=bug_report) | [Other](https://app.dosu.dev/response-feedback/27bde6ae-e161-486e-9d55-48b1ffacd6be?feedback_type=other)</sup>
Author
Owner

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

The error message is pretty straightforward. I think you should reduce the context length.

@crazywoola commented on GitHub (Apr 29, 2025): The error message is pretty straightforward. I think you should reduce the context length.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: langgenius/dify#13518