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 first inspect the provider structure, existing thinking-level mappings, and related tests to identify the established request-shaping pattern before making a minimal change.
- Assistant
The repository already contains generic OpenAI-compatible disable shaping and tests, so I’ll now read that implementation, provider construction/configuration, and fallback tests to determine how DeepSeek is identified and where enabled-level mapping belongs.
- Assistant
DeepSeek detection already exists for response-message handling, while thinking control currently only acts on
offand omits DeepSeek. I’ll inspect the exact detection helpers,SupportsThinkingdelegation, and factory wiring because explicitoffmust survive capability filtering and provider rewrites. - Assistant
The agent intentionally forwards
offregardless of capability, but enabled levels are forwarded only when the provider implementsThinkingCapable. Neither the OpenAI-compatible delegate norHTTPProvidercurrently does. To satisfy both enabled mappings and the requested interface, I’ll trace wrappers and tests around capability propagation, then implement DeepSeek capability detection on the delegate and expose it throughHTTPProvider. - Assistant
I’ll implement provider/host-based DeepSeek detection (not model-name detection, avoiding sending DeepSeek-only fields through unrelated gateways), map all configured enabled levels with
xhighasmaxand the remaining supported enabled levels ashigh, preserveextra_bodyprecedence, and add the requested capability delegation.adaptivewill use DeepSeek’s compatiblehigheffort because it is an enabled internal level but DeepSeek has no adaptive effort value. - Assistant
The implementation is in place. I’ll run the focused OpenAI-compatible, HTTP API, factory, and agent test suites; these cover request serialization, capability propagation, construction/provider naming, fallback, and model-rewrite behavior.
- Assistant
The test command was blocked by the environment because both
GOMODCACHEandGOPATHare unset, not by a code failure. I’ll inspect the repository’s Go/tooling configuration and available local caches, then rerun with explicit writable cache paths. - Assistant
A populated repository-local module/build cache exists. I’ll point Go at those caches and rerun the focused suites without changing repository configuration.
- Assistant
The focused suites pass. Since existing tests predate this feature, I’ll also reproduce the original missing behavior through a temporary external verification program (outside the repository): send public
Chatrequests for every internal level, capture JSON, verify exact fields, verify capability reporting, and confirm non-DeepSeek providers remain unchanged. - Assistant
The public-path reproduction confirms
off,low,medium,high,xhigh, andadaptivemappings, capability exposure, and isolation from non-DeepSeek providers. I’ll now run the complete repository test suite to catch any broader interface or fallback regressions. - Assistant
The full suite reaches and passes all changed/related packages, but the repository-wide command is not fully green due to unrelated environment/pre-existing failures: missing embedded
workspace, missing systemolm/olm.h, unset$HOME, filesystem-permission expectation tests running as root, and an unrelated shell timeout. I’ll verify no test artifacts or unintended files were created, review the final diff, and rerun formatting/static checks on the changed packages.
Other models, same or similar prompt
Responses were produced in different, uncontrolled contexts (system prompts, settings, prior turns). This is not a benchmark.