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 architecture, existing thinking-level mappings, and nearby tests to identify the established request-shaping pattern before making a targeted change.
- Assistant
The OpenAI-compatible provider already contains provider-specific disable shaping and tests, so I’ll read that implementation and how DeepSeek is identified/configured. I’ll also inspect HTTP API delegation because
SupportsThinkingis explicitly part of the requested interface. - Assistant
The key gap is visible:
applyThinkingControlreturns for every enabled level, while DeepSeek recognition already exists elsewhere. I’ll inspect the complete capability methods and factory wiring to ensure enabled levels are actually forwarded by the agent (not filtered before request shaping), including custom HTTP-provider construction. - Assistant
Enabled
thinking_levelvalues are currently dropped because neither OpenAI-compatibleProvidernorHTTPProviderimplementsThinkingCapable. I’ll check factory wrappers and existing capability conventions, then implement capability narrowly for DeepSeek (provider name or official host), preserving behavior for unrelated compatible providers. - Assistant
I’ll inspect the prior thinking-off commit to align with its design intent, especially whether capability detection was deliberately deferred. Then I’ll patch request shaping and delegation with nil-safe capability reporting.
- Assistant
I’ll implement one DeepSeek predicate reused by request shaping and capability reporting. For valid enabled levels,
xhighmaps tomax;low,medium,high, andadaptivemap to DeepSeek’s compatiblehigheffort. Explicitoffalways emits the disable object. Other providers retain their existing off-only behavior, and configuredextra_bodyremains authoritative because it is merged afterward. - Assistant
The patch is focused and formatted. I’ll now run provider and agent tests, then inspect fallback capability selection to verify DeepSeek enabled levels survive model/provider rewrites rather than only direct calls.
- Assistant
Tests could not start because this environment has both
GOMODCACHEandGOPATHunset, not because of code. I’ll supply a temporary standard cache path without modifying the repository, rerun the targeted suites, and review fallback implementation while dependencies compile. - Assistant
All affected package tests pass. To explicitly reproduce and verify the feature (without adding repository tests), I’ll run a temporary HTTP capture program across every valid level, confirming exact JSON fields and the advertised capability. I’ll also test that a non-DeepSeek compatible provider remains unaffected.
- Assistant
The capture reproducer confirms the requested mappings exactly, including no stray
reasoning_effortforoff, and confirms isolation from other providers. I’ll run the full provider subtree once more, review the final diff, and then submit if clean.
Other models, same or similar prompt
Responses were produced in different, uncontrolled contexts (system prompts, settings, prior turns). This is not a benchmark.