Skip to content
TheChatArchiveThe Chat Archive
MiniMaxminimax/minimax-m3· unknownHugging 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. MiniMax Assistant

    Let me start by exploring the repository structure to understand what we're working with.

  3. MiniMax Assistant

    Let me explore the structure moredeeply.

  4. MiniMax Assistant

    Now let's look at the openai_compat package to understand how it currently works:

  5. MiniMax Assistant

    Let me see the truncated part of the file:

  6. MiniMax Assistant

    Now let me check the existing tests for understanding the test conventions:

  7. MiniMax Assistant

    Now let me look at how the SupportsThinking capability is used:

  8. MiniMax Assistant

    Now let me look at the httpapi_facade.go to see if there's a SupportsThinking method already:

  9. MiniMax Assistant

    Now let me check more places where DeepSeek is handled and where SupportsThinking is being added:

  10. MiniMax Assistant

    Let me check the openai_compat.Provider's existing methods:

  11. MiniMax Assistant

    Let me see the recent git log:

  12. MiniMax Assistant

    Let me look at how SupportsNativeSearch is implemented in openai_compat.Provider to follow the same pattern:

  13. MiniMax Assistant

    Let me look at the existing tests for thinking-related features:

  14. MiniMax Assistant

    Let me look at how the httpapi package handles SupportsThinking and other tests:

  15. MiniMax Assistant

    Let me write a quick reproduce script to ensure my understanding of the current state:

  16. MiniMax Assistant

    Let me make a proper test to confirm current state:

  17. MiniMax Assistant

    Let me create a proper Go test file inside the openai_compat package to test current behavior:

  18. MiniMax Assistant

    I've confirmed the current behavior: DeepSeek thinking levels are silently ignored. Now let me clean up the temp test and implement the changes.

  19. MiniMax Assistant

    Now let me look at the full thinking.go to understand the agent flow:

  20. MiniMax Assistant

    Let me look at the agent test patterns for understanding SupportsThinking integration:

  21. MiniMax Assistant

    Let me look at thinkingOptionRecordingProvider:

  22. MiniMax Assistant

    Now I have a complete picture. Let me implement the changes.

    Step 1: Modify openai_compat/provider.go

    First, let me look at the existing applyThinkingControl code:

  23. MiniMax Assistant

    Now let me make the modifications to openai_compat/provider.go:

  24. MiniMax Assistant

    Let me directly edit the file:

  25. MiniMax Assistant

    Now let me update the applyThinkingControl function:

  26. MiniMax Assistant

    Now let me add the deepseek case in the provider name switch and the SupportsThinking method. Let me add the deepseek case in the switch:

  27. MiniMax Assistant

    Now let me add the SupportsThinking method to the openai_compat Provider. Let me first see where SupportsNativeSearch is defined:

  28. MiniMax Assistant

    Now let me add the SupportsThinking method:

  29. MiniMax Assistant

    I noticed I missed a blank line. Let me fix that:

  30. MiniMax Assistant

    I see a duplicated line. Let me fix it:

  31. MiniMax Assistant

    There are duplicate SupportsThinking definitions. Let me clean it up:

  32. MiniMax Assistant

    There are still duplicate SupportsNativeSearch definitions. Let me checkwhat's happening:

  33. MiniMax Assistant

    I see the duplication. Let me look at the file structure:

  34. MiniMax Assistant

    Let me view the file from line 825 to make sure there are no duplicates:

  35. MiniMax Assistant

    The file looks good. Let me fix the missing blank lines for proper formatting:

  36. MiniMax Assistant

    Let me reset the file and start fresh:

  37. MiniMax Assistant

    Good, the file is reset. Now let me apply the changes more carefully using Python:

  38. MiniMax Assistant

    Now let me run the tests to ensure my changes compile:

  39. MiniMax Assistant

    The code compiles. Now let me update HTTPProvider to add SupportsThinking:

  40. MiniMax Assistant

    Let me reset the openai_compat file and start fresh:

  41. MiniMax Assistant

    The file was reset. Let me re-apply changes and properly open the right file:

  42. MiniMax Assistant

    Now let me open the httpapi/http_provider.go file:

  43. MiniMax Assistant

    I need to preserve the original SupportsNativeSearch(). Let me restore that:

  44. MiniMax Assistant

    Let me revert the unnecessary change to SupportsNativeSearch():

  45. MiniMax Assistant

    Now let me verify the diff:

  46. MiniMax Assistant

    Now let me build to ensure both files compile:

  47. MiniMax Assistant

    Now let me write a quick test to validate the behavior:

  48. MiniMax Assistant

    There's an import cycle issue. I can't import httpapi from openai_compat tests. Let me update the test to only check the openai_compat level:

  49. MiniMax Assistant

    The behavior works as expected:

    • off: thinking: {type: "disabled"}
    • low: thinking: {type: "enabled"} + reasoning_effort: "high"
    • medium: thinking: {type: "enabled"} + reasoning_effort: "high"
    • high: thinking: {type: "enabled"} + reasoning_effort: "high"
    • xhigh: thinking: {type: "enabled"} + reasoning_effort: "max"
    • adaptive: ignored (no mapping)

    And SupportsThinking returns true for DeepSeek host or provider name.

    Now let me clean up the temp test and add proper tests:

  50. MiniMax Assistant

    Now let me also test the HTTPProvider:

  51. MiniMax Assistant

    HTTPProvider.SupportsThinking works as expected. Let me clean up:

  52. MiniMax Assistant

    Now let me add proper tests. First let me look at the test patterns:

  53. MiniMax Assistant

    Now let me add the DeepSeek tests. I'll add them right after the existing thinking tests:

  54. MiniMax Assistant

    Let me check the current file:

  55. MiniMax Assistant

    Wait, the file shown by head is openai_compat but the displayed file is http_provider.go. That's odd. Let me check both:

  56. MiniMax Assistant

    Hmm, the http_provider.go is now 229 lines (was 107). Let me look at it:

  57. MiniMax Assistant

    Let me revert the wrong file:

  58. MiniMax Assistant

    OK, the http_provider.go was reverted but the provider_test.go was also reverted (still2056 lines). Let me also check provider_test.go:

  59. MiniMax Assistant

    Good, the provider_test.go was also reverted. Now I'll use Python to apply changes:

  60. MiniMax Assistant

    Now let me also add a test for HTTPProvider.SupportsThinking:

  61. MiniMax Assistant

    There's no http_provider_test.go yet. Let me create one with tests for SupportsThinking:

  62. MiniMax Assistant

    Now let me run all the tests to verify everything works:

  63. MiniMax Assistant

    All new tests pass. Let me also run the httpapi tests:

  64. MiniMax Assistant

    The http_provider.go was reverted. Let me re-apply the SupportsThinking method:

  65. MiniMax Assistant

    Now let me run the tests:

  66. MiniMax Assistant

    All tests pass. Now let me run all the tests in the providers directory to ensure I haven't broken anything:

  67. MiniMax Assistant

    All tests pass! Now let me also check the agent tests that are related to thinking:

  68. MiniMax Assistant

    All agent tests pass. Let me also check the full diff to make sure I haven't missed anything:

  69. MiniMax Assistant

    Let me check the edge case of extra_body interacting with thinking control:

  70. MiniMax Assistant

    Let me verify my implementation matches the interface specification in the issue:

  71. MiniMax Assistant

    The implementation matches the interface spec. Let me run the full test suite once more to confirm nothing is broken:

  72. MiniMax Assistant

    All tests pass. Let me also run the cmd tests just to be safe:

  73. MiniMax Assistant

    Let me check if this is a pre-existing issue:

  74. MiniMax Assistant

    The error is pre-existing. Let me restore my changes:

  75. MiniMax Assistant

    This is a CGO-related issue with the matrix crypto library, unrelated to my changes. Let me only build the providers package:

  76. MiniMax Assistant

    Everything builds and passes vet. Let me also look at the final diff to verify:

  77. MiniMax Assistant

    Let me check that streaming also benefits from the thinking control:

  78. MiniMax Assistant

    Good. Both Chat and ChatStream use buildRequestBody, so the thinking control applies to both.

    Let me also look at the buildRequestBody carefullyto ensure the thinking control is applied before extra_body is merged:

  79. MiniMax Assistant

    Let me also check if there are any other places where DeepSeek thinking handling might be relevant:

  80. MiniMax Assistant

    Let me run all the tests one more time to ensure everything works:

  81. MiniMax Assistant

    All tests pass. Let me also do one final review by viewing the full diff:

  82. MiniMax Assistant

    Let me verify all tests pass one final time:

  83. MiniMax Assistant

    All tests pass. Let me also make a final check that the linting is OK:

  84. MiniMax Assistant

    Let me create a final reproduction script to verify the behavior end-to-end:

  85. MiniMax Assistant

    All mappings work as expected. Let me clean up:

  86. MiniMax Assistant

    Let me also check the diff one more time to ensure everything is good:

  87. MiniMax Assistant

    Let me run the entire test suite once more for final confirmation:

  88. MiniMax Assistant

    All tests pass. Let me also check the documentation/comments are good:

  89. MiniMax Assistant

    Let me also look at the http_provider.go to ensure it's correct:

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