Skip to content

DeepSeek thinking-mode multi-turn fails: reasoning_content not echoed back (provider 400) #3197

Description

@oxoxDev

Summary

DeepSeek (and DeepSeek-via-aggregator) requests in thinking mode fail on multi-turn with a provider 400 Bad Request:

... API error (400 Bad Request): {"error":{"message":"The `reasoning_content` in the thinking mode must be passed back ..."}}

The request builder does not echo the assistant's prior-turn reasoning_content back in the next request's message history, which DeepSeek's thinking mode requires.

Impact

~171 events across several Sentry issues (self-hosted tauri-rust, error_type:inference), second-largest contributor to the generic chat-error cluster. Until fixed, these turns fail; the user now sees an actionable "provider rejected the request" message (added in the classifier-hardening PR for #3119) instead of a bare apology — but the turn still cannot complete.

Likely site

  • src/openhuman/inference/provider/compatible.rs — OpenAI-compatible request builder.
  • src/openhuman/context/pipeline.rs / context/microcompact.rs — where assistant turns are assembled into request history (existing reasoning_content handling lives here).

The builder must re-attach reasoning_content to prior assistant messages when the active model is in thinking mode.

Acceptance

  • Multi-turn DeepSeek thinking-mode conversation completes without the reasoning_content must be passed back 400.
  • Round-trip preserved across compaction/microcompact.
  • Unit coverage for the request-assembly path.

Related

Metadata

Metadata

Assignees

Labels

Type

No type

Fields

No fields configured for issues without a type.

Projects

Status
Done

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions