mirror of
https://github.com/HKUDS/DeepTutor.git
synced 2026-12-04 11:40:34 +08:00
DeepSeek V4 thinking models (v4-flash, v4-pro) served through the
Responses API reject continuation requests whose input is missing the
prior assistant turn's reasoning item:
The reasoning_text in the thinking mode must be passed back to the API.
Histories persisted before reasoning items were stored (or reused after
a provider/model switch) cannot satisfy the replay, and because the
error text matched none of the existing markers in
_should_fallback_from_responses_error, callers received a hard failure
instead of the existing Chat Completions degradation.
Add reasoning_text / reasoning_content / passed back / thinking mode as
recognized fallback markers. The Chat Completions path already sends
`thinking: disabled` for deepseek-v4-flash (#1058), so the fallback is
safe and preserves the turn; the circuit breaker then stops retrying the
Responses path for the probe interval.
Context: #1048, #1175.