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 trace the OpenAI-compatible request shaping and existing provider-specific thinking logic, then implement DeepSeek mapping consistently with current conventions. I’ll run focused tests (and broader relevant tests if practical), inspect the diff, and only then submit.
- Assistant
rgis unavailable in the environment, so I’ll usegrepinstead and continue locating the relevant implementation. - Assistant
The current path only shapes explicit
offfor a few providers, and the HTTP wrapper does not exposeSupportsThinking; consequently DeepSeek enabled levels are dropped by the agent before reaching the request builder. I’ll add DeepSeek capability detection (provider name or DeepSeek host), expose it throughHTTPProvider, and shape all valid enabled levels while preservingextra_bodyprecedence. - Assistant
The code is formatted and the diff is limited to the intended provider layers. The first test attempt was blocked by the environment because neither
GOMODCACHEnorGOPATHis configured (and the package list command also contained an accidental comma); I’ll retry with temporary Go cache paths and focused packages. - Assistant
With temporary
GOPATH, module cache, and build cache configured, the focused suites pass (openai_compat,httpapi, andagent). I’ll do one broader provider-package run and review the final diff for unintended changes before submitting.
Other models, same or similar prompt
Responses were produced in different, uncontrolled contexts (system prompts, settings, prior turns). This is not a benchmark.