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 start by exploring the repository structure and how thinking_level is currently handled for OpenAI-compatible providers.
- Assistant
Let me search more specifically for thinking related code.
- Assistant
Strange, no results. Let me try without --type go
- Assistant
rg is not available. Let me use grep.
- Assistant
I'll inspect the OpenAI-compat provider and related thinking-mapping code next.
- Assistant
There's already partial thinking control — I'll read the full implementation and tests.
- Assistant
I'll check the existing tests and how SupportsThinking is implemented for other providers.
- Assistant
Let me also look at http_provider.go SupportsThinking and how deepseek is identified elsewhere. Also check agent thinking handling related to warnings.
- Assistant
I'll examine agent thinking handling and the OpenAI-compat tests to see the expected behavior.
- Assistant
I'll check provider metadata and how SupportsThinking is wired for OpenAI-compat/DeepSeek.
- Assistant
Let me look at agent_test.go around the fallback thinking tests - they might already have patterns for DeepSeek.
- Assistant
I'll also inspect how the factory creates providers and how the openai_compat provider is structured.
- Assistant
I'll check Anthropic mapping and DeepSeek docs references for complete mapping details.
- Assistant
Let me also check if legacy_provider or factory wraps HTTPProvider in a way that SupportsThinking is preserved.
- Assistant
I have a clear plan. Implementing DeepSeek thinking mapping and SupportsThinking, then adding tests.
- Assistant
Implementing DeepSeek thinking mapping in
applyThinkingControland addingSupportsThinking. - Assistant
I'll verify the file structure around SupportsThinking and the host helpers.
- Assistant
Next I'll add SupportsThinking to HTTPProvider.
- Assistant
I'll fix the duplicate line introduced in http_provider.go.
- Assistant
I'll add tests for DeepSeek thinking mapping next.
- Assistant
I'll look for existing HTTP provider tests and add a SupportsThinking case.
- Assistant
I shouldn't modify repository tests — reverting those changes and using a temporary script instead.
- Assistant
I'll run the existing thinking-related tests and a temporary verification script.
- Assistant
Need to set GOCACHE
- Assistant
Temp mapping tests passed. Next I'll cover HTTPProvider/agent paths and clean up the temp test file.
- Assistant
All tests passed. I'll run the full openai_compat suite and remove the temp test files.
- Assistant
I'll restore the trailing newline in http_provider.go.
- Assistant
I'll quickly verify CreateProvider exposes SupportsThinking for DeepSeek.
- Assistant
Need to run from picoclaw directory
- Assistant
Factory path looks good. Final diff check, then submit.
Other models, same or similar prompt
Responses were produced in different, uncontrolled contexts (system prompts, settings, prior turns). This is not a benchmark.