ISSUE DESCRIPTION [Feature] Map thinkinglevel to DeepSeek thinking fields 🎯 The Goal /…
- User
ISSUE DESCRIPTION
[Feature] Map thinking_level to DeepSeek thinking fields
🎯 The Goal / Use Case
DeepSeek is currently treated as an OpenAI-compatible provider in PicoClaw, but its thinking-mode controls do not match the internal
thinking_levelabstraction 1:1.Please implement correct DeepSeek thinking mapping so that:
- explicit
thinking_level: "off"automatically disables DeepSeek thinking mode - thinking-enabled levels are translated to DeepSeek's documented OpenAI-compatible fields
- DeepSeek users can rely on the same
thinking_levelconfig without needing manualextra_bodyoverrides
💡 Proposed Solution
Add DeepSeek-specific request shaping on the OpenAI-compatible path.
Suggested mapping:
thinking_level: "off"->thinking: { "type": "disabled" }thinking_level: "high"->thinking: { "type": "enabled" }+reasoning_effort: "high"thinking_level: "xhigh"->thinking: { "type": "enabled" }+reasoning_effort: "max"
If
low/mediumare kept as valid internal levels, they can follow DeepSeek's documented compatibility behavior and map toreasoning_effort: "high".🛠 Potential Implementation (Optional)
PR #2898 already introduced explicit
thinking_level: "off"handling for several OpenAI-compatible providers and added provider-specific disable-field shaping.This issue is to extend that work for DeepSeek specifically:
- add DeepSeek request shaping on the OpenAI-compatible provider path
- map internal thinking levels to DeepSeek's
thinkingandreasoning_effortfields - ensure explicit
offis sent even when DeepSeek does not advertise generic thinking support viaSupportsThinking() - add tests covering both request shaping and fallback/rewrite paths if applicable
🚦 Impact & Roadmap Alignment
- This is a Core Feature
- This is a Nice-to-Have / Enhancement
- This aligns with the current Roadmap
🔄 Alternatives Considered
- explicit
- Assistant
I'll explore the repository structure and how thinking_level is currently mapped for OpenAI-compatible providers, then implement DeepSeek-specific mapping.
- Assistant
Let me search for thinking_level related code and DeepSeek provider handling.
- Assistant
rg is not available, let me use grep instead.
- Assistant
I'll inspect the OpenAI-compat thinking mapping and tests next.
- Assistant
I'll check existing thinking control tests and how SupportsThinking is implemented.
- Assistant
Let me look at http_provider.go for SupportsThinking and also agent thinking.go, and any PR-related comments. Also check if there's a deepseek provider specifically.
- Assistant
There was an error with the command. Let me try simpler commands.
- Assistant
Interesting - grep found nothing in http_provider.go for SupportsThinking. Let me read the file.
- Assistant
The agent only applies non-off thinking_level when SupportsThinking is true — checking whether DeepSeek/openai_compat advertises that.
- Assistant
Checking how factories set provider names and whether related work exists on branches or docs.
- Assistant
Let me also check how anthropic maps thinking and any comments about DeepSeek reasoning_effort. Also, look at DeepSeek docs mapping more carefully. I need to implement the DeepSeek-specific thinking mapping as described in the issue. Let me start by examining the current codebase structure to understand where to make changes.
First, let me check the current state of the repository and find relevant files. I'll use git status to see what's currently tracked.
- Assistant
I'll check whether facades already forward ThinkingCapable and how DeepSeek is registered.
- Assistant
Implementing DeepSeek thinking mapping in openai_compat and delegating SupportsThinking from HTTPProvider.
- Assistant
I'll replace applyThinkingControl and update thinkingControlKind, add SupportsThinking.
- Assistant
Next I'll add SupportsThinking on HTTPProvider to delegate to openai_compat.
- Assistant
I'll add tests for DeepSeek thinking mapping next to the existing thinking control tests.
- Assistant
I'll insert DeepSeek tests after the Doubao preserve test.
- Assistant
Checking for existing HTTP provider tests and adding a SupportsThinking case if needed.
- Assistant
I added tests against the guidelines — removing them and verifying with a temporary script instead.
- Assistant
I'll restore the test file from git since the multi-line replace didn't match.
- Assistant
I'll verify with a temporary in-package test, then remove it.
- Assistant
Import cycle hit — I'll split the HTTPProvider temp test and set GOCACHE.
- Assistant
All temp checks passed. Cleaning up temp files and running the full package tests.
Other models, same or similar prompt
Responses were produced in different, uncontrolled contexts (system prompts, settings, prior turns). This is not a benchmark.