Files
codewhale/crates
Beltran12138 ca284d1fc0 fix: treat deepseek-chat / deepseek-reasoner aliases as reasoning models
`requires_reasoning_content()` only matched literal `deepseek-v4*` model
IDs, but `deepseek-chat` and `deepseek-reasoner` are DeepSeek's public
API aliases that resolve server-side to `deepseek-v4-flash` and
`deepseek-v4-pro` respectively. Both have thinking mode enabled by
default, so when a user sets `default_text_model = "deepseek-chat"` (the
value `deepseek auth` / onboarding writes), the thinking-mode sanitizer
is skipped and tool-call assistant messages are sent without
`reasoning_content`. DeepSeek then rejects the second turn with:

  HTTP 400: The `reasoning_content` in the thinking mode must be passed
  back to the API.

Extend `requires_reasoning_content()` to recognise the `deepseek-chat`
and `deepseek-reasoner` alias prefixes (covering suffixed variants like
`deepseek-chat:free` used by proxied deployments). The explicit
`reasoning_effort = "off"` escape hatch still disables replay via the
unchanged `should_replay_reasoning_content()` check.

Adds `alias_thinking_detection_tests` covering the aliases, explicit V4
IDs (regression guard), excluded non-thinking models, suffixed variants,
and the reasoning-off override.

Refs: https://api-docs.deepseek.com/guides/thinking_mode
(cherry picked from commit 46941142123827fa16fc9a1fb41b78c293e935ce)
2026-05-11 07:34:50 -05:00
..
2026-05-10 20:40:20 -05:00
2026-05-10 20:40:20 -05:00
2026-05-10 20:40:20 -05:00
2026-05-10 20:40:20 -05:00
2026-05-10 20:40:20 -05:00
2026-05-10 20:40:20 -05:00
2026-05-10 20:40:20 -05:00
2026-05-10 20:40:20 -05:00