Skip to content
TheChatArchiveThe Chat Archive
DeepSeekdeepseek/deepseek-v4-pro· deepseekHugging Face ibragim-bad/swe_rebench_07_2026_trajectories

ISSUE DESCRIPTION [Feature] Map thinkinglevel to DeepSeek thinking fields 🎯 The Goal /…

  1. 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_level abstraction 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_level config without needing manual extra_body overrides

    💡 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 / medium are kept as valid internal levels, they can follow DeepSeek's documented compatibility behavior and map to reasoning_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 thinking and reasoning_effort fields
    • ensure explicit off is sent even when DeepSeek does not advertise generic thinking support via SupportsThinking()
    • 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

    • Ask users to configure DeepSeek manually with extra_body
    • Keep DeepSeek on the generic OpenAI-compatible path without provider-specific thinking mapping

    Both alternatives are weaker because they make DeepSeek behavior inconsistent with the project-wide thinking_level abstraction.

    💬 Additional Context

    https://api-docs.deepseek.com/zh-cn/guides/thinking_mode

    DeepSeek's documented OpenAI-compatible thinking controls use:

    • thinking.type
    • reasoning_effort
    • reasoning_content in responses

    PR #2898 is closely related because it establishes the explicit-off behavior and provider-specific request shaping pattern. DeepSeek appears to still need its own mapping added on top of that work.

    Interface

    Type: Function Name: SupportsThinking Path: pkg/providers/httpapi/http_provider.go Input: () Output: bool Description: Exposes the thinking capability of the underlying provider delegate over the HTTP API. Returns true if the delegate supports thinking; otherwise false.

    ADDITIONAL ADVICE

    Since you are given a git repository, you can use git commands to simplify your work. For example, if you made a mistake and want to revert your changes, you can use git checkout <file> to restore the file to its original state. You can also reset all changes in the repository using git reset --hard command. Additionally, you can use git stash and git stash pop to temporarily save your changes and restore them later. Finally, you can see the changes that you've made (which will be submitted when you call submit) using git status or git diff commands. However you don't need to use git add or git commit before submitting your changes. In fact, submit only submits currently unstaged changes because it uses git diff to get the changes that need to be submitted.

    CHECKLIST

    Before submitting your solution, please go over the following checklist and make sure you've done everything:

    • If an error was reported in the issue description, I have successfully reproduced it.
    • If an error was reported in the issue description, I have confirmed that my fix resolves the error.
    • I have thought about edge cases and made sure my fix handles them as well.
    • I have run existing tests in the repository that might have been affected by the change I made and confirmed that they pass. I want you to list every bullet from this checklist and write your reasoning for why you think you did it or didn't need to.

    Repository has been uploaded and your shell is currently at the repository root. Time to solve the issue!

    (Current directory: /picoclaw, current file: none) bash-$

  2. DeepSeek Assistant

    Let me start by understanding the repository structure and the issue. The issue asks me to:

    1. Map thinking_level to DeepSeek's thinking fields
    2. Add DeepSeek-specific request shaping on the OpenAI-compatible path
    3. Map internal thinking levels to DeepSeek's thinking and reasoning_effort fields
    4. Ensure explicit off is sent even when DeepSeek does not advertise generic thinking support

    Let me explore the repository structure first.

  3. DeepSeek Assistant

    Let me search for more relevant files related to thinking, deepseek, and providers.

  4. DeepSeek Assistant

    Let me search for the specific files mentioned in the issue

  5. DeepSeek Assistant

    Good, now I can see the relevant files. Let me examine the key files:

  6. DeepSeek Assistant

    Let me read the files one at a time

  7. DeepSeek Assistant

    I see http_provider.go doesn't have SupportsThinking. Let me search for it.

  8. DeepSeek Assistant

    Let me look at the thinking capability interface and implementations.

  9. DeepSeek Assistant

    Now let me look at how thinking is handled in the agent/thinking.go and the openai_compat provider.

  10. DeepSeek Assistant

    Now let me look at the openai_compat provider.

  11. DeepSeek Assistant

    Let me see more of the provider and the factory/provider catalog

  12. DeepSeek Assistant

    Let me look at the provider catalog to understand how DeepSeek is defined.

  13. DeepSeek Assistant

    Let me find where modelProviderOptionForName and modelProviderOptionsByName are defined.

  14. DeepSeek Assistant

    Let me look at the provider_metadata.go file to understand the DeepSeek provider definition.

  15. DeepSeek Assistant

    Now let me look at the test file and the full applyThinkingControl method more carefully

  16. DeepSeek Assistant

    Now let me look at the full applyThinkingControl and thinkingControlKind methods:

  17. DeepSeek Assistant

    Let me read lines 196-280 of the provider.go file.

  18. DeepSeek Assistant

    Let me check the Gemini provider for reference on how thinking is implemented there

  19. DeepSeek Assistant

    Let me check how provider name is set and look at the full flow more

  20. DeepSeek Assistant

    Let me look at lines 289-310 of provider

  21. DeepSeek Assistant

    Let me check where tests reference deepseek in the test file

  22. DeepSeek Assistant

    Let me read the test file around the DeepSeek tests to understand patterns

  23. DeepSeek Assistant

    Let me look at the thinking-related tests around lines 55-130

  24. DeepSeek Assistant

    Now I have a comprehensive understanding of the codebase. Let me implement the solution.

    Here's my plan:

    1. Add "deepseek" to thinkingControlKind in openai_compat/provider.go
    2. Modify applyThinkingControl to handle enabled thinking levels for DeepSeek
    3. Add SupportsThinking() to openai_compat.Provider and HTTPProvider
    4. Add tests

    Let me first open the provider.go

  25. DeepSeek Assistant

    Let me look at the full applyThinkingControl and thinkingControlKind section

  26. DeepSeek Assistant

    Now I'll make the changes. Let me start with modifying applyThinkingControl to handle all thinking levels, and add DeepSeek to thinkingControlKind

  27. DeepSeek Assistant

    Now let me add SupportsThinking() method to the openai_compat.Provider. Let me find where to

  28. DeepSeek Assistant

    Let me see the SupportsNativeSearch and add SupportsThinking after

  29. DeepSeek Assistant

    Now let me add the SupportsThinking method

  30. DeepSeek Assistant

    Now let me add SupportsThinking() to the HTTPProvider as well.

  31. DeepSeek Assistant

    Add SupportsThinking to HTTPProvider after SupportsNativeSearch:

  32. DeepSeek Assistant

    Wait, I need to reconsider. My change would break existing behavior for non-DeepSeek providers (like volcengine/doubao) that use thinking_type - they should only handle off, not enabled levels. Let me refine the approach to only expand thinking levels for DeepSe

  33. DeepSeek Assistant

    I accidentally edited the wrong file! Let me check the damage and

  34. DeepSeek Assistant

    I need to fix http_provider.go - remove the wrongly appended code. Let me use git to restore the original

  35. DeepSeek Assistant

    Let me check the openai_compat provider state and redo everything

  36. DeepSeek Assistant

    Good, the openai_compat changes are intact. Let me check the SupportsThinking method too

  37. DeepSeek Assistant

    Now I need to fix the openai_compat/provider.go to not break volcengine behavior. Let me refine `applyThinkingControl

  38. DeepSeek Assistant

    I accidentally edited the wrong file again. Let me fix both files properly. First revert http_provider.go

  39. DeepSeek Assistant

    Now let me open the right file and edit it properly

  40. DeepSeek Assistant

    Let me use the correct syntax for open

  41. DeepSeek Assistant

    Now let me fix the applyThinkingControl to only expand thinking levels for DeepSeek, preserving existing behavior for others

  42. DeepSeek Assistant

    Good. Now let me add SupportsThinking to the HTTPProvider

  43. DeepSeek Assistant

    Now let me add SupportsThinking to HTTP

  44. DeepSeek Assistant

    Now let me verify the code compiles and run the

  45. DeepSeek Assistant

    Let me check the Go

  46. DeepSeek Assistant

    Let me set up the Go module cache properly

  47. DeepSeek Assistant

    Let me set both

  48. DeepSeek Assistant

    The code compiles. Now let me run the existing tests.

  49. DeepSeek Assistant

    All existing thinking tests pass. Let me run the full test suite for both

  50. DeepSeek Assistant

    All tests pass. Let me also run other related

  51. DeepSeek Assistant

    All tests pass. Let me run the agent tests related to

  52. DeepSeek Assistant

    All tests pass. Let me run the full providers test suite

  53. DeepSeek Assistant

    Now let me add tests for the DeepSeek thinking mapping. Let me open the test file

  54. DeepSeek Assistant

    Let me find the exact end of the thinking tests and add my new tests there

  55. DeepSeek Assistant

    Now let me add the DeepSeek thinking tests right after line 125

  56. DeepSeek Assistant

    I'm concerned the edit may have broken the previous test's closing braces. Let me check

  57. DeepSeek Assistant

    I broke the previous test's closing braces. Let me fix this

  58. DeepSeek Assistant

    Let me check the rest of the newly

  59. DeepSeek Assistant

    Let me now compile and run the new

  60. DeepSeek Assistant

    All new tests pass. Let me run the full test suite one more time to be

  61. DeepSeek Assistant

    All tests pass. Let me also run the agent tests to confirm nothing

  62. DeepSeek Assistant

    Let me review my final changes with git

  63. DeepSeek Assistant

    Let me quickly verify the tool schema transform provider passes through SupportsThinking correctly

  64. DeepSeek Assistant

    The changes look comprehensive and correct. Let me verify one final edge case - the agent thinking flow works correctly end-to-end for DeepSeek by checking the complete

  65. DeepSeek Assistant

    That build error appears pre-existing and unrelated to my changes. Let me confirm by building only the affected packages

  66. DeepSeek Assistant

    That's an unrelated C dependency issue. Let me build just the provider

Responses were produced in different, uncontrolled contexts (system prompts, settings, prior turns). This is not a benchmark.