Skip to content

fix: route deepseek through chat completions#6

Merged
razmser merged 1 commit into
mainfrom
deepseek-chat-completions
Jul 25, 2026
Merged

fix: route deepseek through chat completions#6
razmser merged 1 commit into
mainfrom
deepseek-chat-completions

Conversation

@razmser

@razmser razmser commented Jul 25, 2026

Copy link
Copy Markdown
Collaborator

The Anthropic message format drops reasoning blocks that carry no signature, and DeepSeek never issues one. A reasoning-only assistant turn — which DeepSeek produces routinely, since it returns reasoning_content with empty content — therefore lowers to content: [], and the API rejects the whole request with "all messages must have non-empty content". Once such a turn is in the history every later request in that session fails, so the session is unrecoverable.

Chat Completions lowers the same turn to content: "", which DeepSeek accepts, and round-trips reasoning_content as its thinking mode requires — something the Anthropic route cannot do at all.

The Anthropic message format drops reasoning blocks that carry no
signature, and DeepSeek never issues one. A reasoning-only assistant
turn — which DeepSeek produces routinely, since it returns
reasoning_content with empty content — therefore lowers to
`content: []`, and the API rejects the whole request with "all messages
must have non-empty content". Once such a turn is in the history every
later request in that session fails, so the session is unrecoverable.

Chat Completions lowers the same turn to `content: ""`, which DeepSeek
accepts, and round-trips reasoning_content as its thinking mode
requires — something the Anthropic route cannot do at all.
@razmser
razmser merged commit c8c7735 into main Jul 25, 2026
1 check passed
@razmser
razmser deleted the deepseek-chat-completions branch July 25, 2026 01:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant