mirror of
https://github.com/deepseek-ai/DeepSeek-R1.git
synced 2026-11-05 00:47:42 +00:00
[GH-ISSUE #21] deepseek-reasoner does not support successive user or assistant messages #21
Labels
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
deepseek-ai/DeepSeek-R1#21
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @Sariel2 on GitHub (Jan 21, 2025).
Original GitHub issue: https://github.com/deepseek-ai/DeepSeek-R1/issues/21
when i use deepseek-reasoner in cursor, error like this.
@YuBai630 commented on GitHub (Jan 21, 2025):
I meet the same problem.
@Sariel2 commented on GitHub (Jan 21, 2025):
In the same CONFIG, deepseek-chat model could reply success.
@Julianlaue commented on GitHub (Jan 21, 2025):
I encountered the same issue. It's very weird. I tried multiple times with and without context. Interestingly, it worked without context when using the @ symbol. After having a normal conversation without context and gradually introducing context, it started working. Now, it consistently works, even when directly introducing context via the @ symbol. It’s very strange, but I suggest trying it multiple times with different versions of context until it works.
@engalisabry commented on GitHub (Jan 21, 2025):
Issue Description
The error occurs when using
deepseek-reasonerwith successive user or assistant messages (e.g.,messages[1]andmessages[2]being of the same role). The model expects interleaved user/assistant messages in the message sequence.Why This Happens
deepseek-reasonermodel is designed to follow a strict conversational format, where user and assistant messages must alternate.invalid_request_error.Workarounds and Solutions
Interleave Messages Correctly:
Ensure that the message sequence alternates between
userandassistantroles. For example:Avoid Successive Same-Role Messages:
If your input contains multiple user or assistant messages in a row, merge them into a single message. For example:
Before::
After::
3. Gradually Introduce Context (As Reported by @Julianlaue)
@symbol or other methods.Why
deepseek-chatWorks DifferentlyThe
deepseek-chatmodel may have a more flexible input format, allowing successive messages of the same role. This difference in behavior is due to the distinct training and design goals of the two models.@Zijie-Tian commented on GitHub (Jan 22, 2025):
Same Issue !!!
@namp commented on GitHub (Jan 22, 2025):
Possible solution?
https://x.com/rohanpaul_ai/status/1881378066603126874
@xiaoxu193 commented on GitHub (Jan 24, 2025):
Running into this while using Cursor with deepseek-reasoner.
@CH0918 commented on GitHub (Jan 24, 2025):
Remove the global settings for Rules for AI and you're good to go.
@Slim0729 commented on GitHub (Jan 25, 2025):
Thanks. It works!
@fengerzh commented on GitHub (Jan 25, 2025):
No, I've already empty the setting for Rules for AI, and even uncheck the
Include .cursorrules fileoption, but it still refuse to answer.@li2109 commented on GitHub (Jan 25, 2025):
+1
@di-su commented on GitHub (Jan 25, 2025):
weird, sometimes work, sometimes doesnt
@clinchcc commented on GitHub (Jan 26, 2025):
The same isuue
@akilcelen commented on GitHub (Jan 26, 2025):
anyone found a solution?
@Hanif-adedotun commented on GitHub (Jan 27, 2025):
+1
Thanks, this worked for me.
@luojiyin1987 commented on GitHub (Jan 31, 2025):
no include .cursorrrules files.
@AuroraGeeker commented on GitHub (Feb 8, 2025):
Modifying the value of the
Base URLmakes it work. To do this, delete the suffix"/v1"in theBase URL.@kikyoulg commented on GitHub (Mar 11, 2025):
我这没用
@gykxjtu commented on GitHub (Apr 4, 2025):
Same issue in Emacs gptel when resume previous session.
@Mr-houzi commented on GitHub (Apr 21, 2025):
use a new chat
@github-actions[bot] commented on GitHub (Jun 1, 2025):
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. If you believe this issue is still relevant, please leave a comment to keep it open. Thank you for your contributions!
@github-actions[bot] commented on GitHub (Jun 18, 2025):
false