after upgrade to 0.15.3, original deepseek r1 LLM call failed #8100

Closed
opened 2026-02-21 18:23:55 -05:00 by yindo · 2 comments
Owner

Originally created by @chinesewebman on GitHub (Feb 9, 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

0.15.3

Cloud or Self Hosted

Self Hosted (Docker)

Steps to reproduce

I deployed an simple app with deepseek r1 LLM from original deepseek.com API provider under dify 0.15.2, it works.

after I upgrade dify to 0.15.3, LLM call fails. if I change LLM provider from deepseek.com to openrouter, it works again.

✔️ Expected Behavior

the LLM call of deepseek r1 from deepseek.com (the original provider of deepseek r1) works.

Actual Behavior

[deepseek] Error: API request failed with status code 400: {"error":{"message":"deepseek-reasoner does not support successive user or assistant messages (messages[0] and messages[1] in your input). You should interleave the user/assistant messages in the message sequence.","type":"invalid_request_error","param":null,"code":"invalid_request_error"}}

Originally created by @chinesewebman on GitHub (Feb 9, 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 0.15.3 ### Cloud or Self Hosted Self Hosted (Docker) ### Steps to reproduce I deployed an simple app with deepseek r1 LLM from original deepseek.com API provider under dify 0.15.2, it works. after I upgrade dify to 0.15.3, LLM call fails. if I change LLM provider from deepseek.com to openrouter, it works again. ### ✔️ Expected Behavior the LLM call of deepseek r1 from deepseek.com (the original provider of deepseek r1) works. ### ❌ Actual Behavior [deepseek] Error: API request failed with status code 400: {"error":{"message":"deepseek-reasoner does not support successive user or assistant messages (messages[0] and messages[1] in your input). You should interleave the user/assistant messages in the message sequence.","type":"invalid_request_error","param":null,"code":"invalid_request_error"}}
yindo added the 🐞 bug label 2026-02-21 18:23:55 -05:00
yindo closed this issue 2026-02-21 18:23:55 -05:00
Author
Owner

@dosubot[bot] commented on GitHub (Feb 9, 2025):

The error you're encountering with the deepseek r1 LLM call after upgrading to Dify 0.15.3 is due to a change in how message sequences are handled. The error message indicates that the deepseek-reasoner requires interleaved user/assistant messages, meaning that the sequence of messages should alternate between user and assistant.

To resolve this issue, ensure that your message sequence is correctly interleaved. For example, if you have two consecutive user messages or two consecutive assistant messages, you need to adjust the sequence so that each user message is followed by an assistant message and vice versa. This requirement seems to be specific to the deepseek r1 provider and was not enforced in the previous version you were using.

To continue talking to Dosu, mention @dosu.


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

@dosubot[bot] commented on GitHub (Feb 9, 2025): <!-- Answer --> The error you're encountering with the deepseek r1 LLM call after upgrading to Dify 0.15.3 is due to a change in how message sequences are handled. The error message indicates that the deepseek-reasoner requires interleaved user/assistant messages, meaning that the sequence of messages should alternate between user and assistant. To resolve this issue, ensure that your message sequence is correctly interleaved. For example, if you have two consecutive user messages or two consecutive assistant messages, you need to adjust the sequence so that each user message is followed by an assistant message and vice versa. This requirement seems to be specific to the deepseek r1 provider and was not enforced in the previous version you were using. <!-- 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/280b312d-4ad9-473d-b778-291b842c2b6e?feedback_type=great_response) | [Irrelevant Answer](https://app.dosu.dev/response-feedback/280b312d-4ad9-473d-b778-291b842c2b6e?feedback_type=irrelevant_answer) | [Incorrect Sources](https://app.dosu.dev/response-feedback/280b312d-4ad9-473d-b778-291b842c2b6e?feedback_type=incorrect_sources) | [Too Verbose](https://app.dosu.dev/response-feedback/280b312d-4ad9-473d-b778-291b842c2b6e?feedback_type=too_verbose) | [Hallucination](https://app.dosu.dev/response-feedback/280b312d-4ad9-473d-b778-291b842c2b6e?feedback_type=hallucination) | [Other](https://app.dosu.dev/response-feedback/280b312d-4ad9-473d-b778-291b842c2b6e?feedback_type=other)</sup>
Author
Owner

@chinesewebman commented on GitHub (Feb 9, 2025):

thanks! I changed the first user role content (the context related instruction) to system role, it works !

@chinesewebman commented on GitHub (Feb 9, 2025): thanks! I changed the first user role content (the context related instruction) to system role, it works !
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: langgenius/dify#8100