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
Now let's look at
applyThinkingControlandSupportsThinkingfor openai_compat provider and thinking.go usage.Assistant
Now let's check
pkg/providers/types.goforThinkingCapableinterface and howproviders.LLMProviderrelates toHTTPProviderusage / factory.Assistant
Good, this matches expectations. Now let's implement the changes.
Assistant
Now let's implement the changes to
applyThinkingControlto add DeepSeek-specific handling, plusisDeepSeek()helper andSupportsThinking()method.Assistant
Now add
SupportsThinking()toHTTPProviderin http_provider.go:Assistant
Now let's build and run relevant tests.
Assistant
Good, builds fine. Now run tests for openai_compat and agent packages.
Assistant
Now let's try building/testing the agent package (avoiding the cgo issue by using build tags or CGO_ENABLED=0).
Assistant
All good. Now let's write a reproduce/verification script for the DeepSeek mapping and also add tests (temporary script, not modifying test files) to confirm behavior matches issue spec.
Assistant
This matches exactly the expected mapping from the issue. Now remove the temporary test file, and run the full test suite for the affected packages again.
Assistant
All tests pass. Let's also check factory_provider.go to see how DeepSeek gets its provider instance and whether
SetProviderNamegets called with "deepseek" for the actual config path.Assistant
End-to-end test passes, confirming the full chain works. Now clean up the temp test file.
Assistant
Now let's run the full relevant test suites one more time to make sure everything passes cleanly after cleanup.
Assistant
All tests pass. Let's view the final diff to review changes.
Assistant
This looks clean and correct. Let's do a final full test run across all packages that build fine (excluding cgo-broken one) to be extra safe.
Assistant
These remaining errors are pre-existing environment issues (missing
olm.hC library and missing embed workspace files), unrelated to my change. Let's confirm they existed before my changes too by checking git stash.Assistant
Confirmed — these build errors are pre-existing environment issues unrelated to my change (missing
olm.hcgo lib and missing embedded workspace files), present both before and after my modifications.Assistant
Everything is clean. Let's go through the checklist:
Assistant
That's just a passthrough field, no changes needed there. The implementation is complete and well-tested. Let's do a final full verification run of both affected test suites.
Assistant
Other models, same or similar prompt
Responses were produced in different, uncontrolled contexts (system prompts, settings, prior turns). This is not a benchmark.