[Fix] DeepSeek 400 errors when mixed-model tasks continue long conversations#270
Draft
roomote[bot] wants to merge 1 commit into
Draft
[Fix] DeepSeek 400 errors when mixed-model tasks continue long conversations#270roomote[bot] wants to merge 1 commit into
roomote[bot] wants to merge 1 commit into
Conversation
Contributor
Author
|
1 issue outstanding; 2 checks still running. Action required. See task
|
| role: "assistant", | ||
| content: assistantContent, | ||
| } satisfies Anthropic.Messages.MessageParam) | ||
| ...(shouldReplayReasoningContent ? { reasoning_content: preservedReasoningContent } : {}), |
Contributor
Author
There was a problem hiding this comment.
prepareApiConversationMessage() only stores top-level reasoning_content for apiProtocol === "openai" (src/core/task/apiConversationHistory.ts). Anthropic-style thinking providers in this repo still set info.preserveReasoning (for example MiniMax and the Bedrock Kimi/MiniMax models) but persist their reasoning as embedded blocks, so this branch now strips the reasoning those continuations need.
Codecov Report❌ Patch coverage is
📢 Thoughts on this report? Let us know! |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Related GitHub Issue
Closes: #201
Description
This fixes the mixed-model DeepSeek history path behind the recurring 400
reasoning_contenterror.Assistant turns from OpenAI-style reasoning models now persist explicit
reasoning_contentmetadata when that model requires replay, and request rebuilding only sends that metadata back for the assistant turns that were originally marked for it. That prevents long tasks from replaying generic reasoning blocks from other agents or models as if they were DeepSeek continuation history.Test Procedure
pnpm --dir src exec vitest run core/task/__tests__/apiConversationHistory.spec.ts api/transform/__tests__/openai-format.spec.ts core/task/__tests__/Task.persistence.spec.ts api/providers/__tests__/deepseek.spec.tspnpm --dir src check-typespnpm --dir apps/web-roo-code test, but this checkout does not containapps/web-roo-code, so that validation path could not run here.Pre-Submission Checklist
Screenshots / Videos
Not applicable for this internal conversation-history fix.
Documentation Updates
Additional Notes
The fix also adds regression coverage around request rebuilding so DeepSeek-marked assistant turns keep their own
reasoning_contentwhile unrelated reasoning from other models is stripped before replay.Get in Touch
Roomote (task
0mzxfggobdyyv)