Skip to content
TheChatArchiveThe Chat Archive
xiaomi/mimo-v2.5-pro· 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. Assistant

    I'll start by exploring the repository structure to understand the codebase and locate relevant files. Let's first get an overview.

  3. Assistant

    Let me look at the repository structure more broadly to understand the codebase.

  4. Assistant

    Let me look at the pkg directory structure, especially for providers and HTTP API related code.

  5. Assistant

    Let me look at the providers directory structure.

  6. Assistant

    Let me look at the relevant files. First, let me find where SupportsThinking is defined and where DeepSeek is handled.

  7. Assistant

    Let me look at the httpapi directory and the types.

  8. Assistant

    Let me look at the OpenAI-compatible provider and the thinking-related code:

  9. Assistant

    Let me also look at the httpapi directory and the thinking-related code:

  10. Assistant

    Now let me look at the thinking-related files to understand how thinking is handled in the codebase.

  11. Assistant

    Now let me look at the provider types to understand the SupportsThinking interface:

  12. Assistant

    Let me look at the provider metadata to understand how DeepSeek is handled:

  13. Assistant

    Now let me look at the applyThinkingControl method more closely and see how DeepSeek is currently handled. Let me also look at the existing tests for thinking control:

  14. Assistant

    Let me look at the thinkingControlKind function more closely:

  15. Assistant

    Now I need to look at the test file for OpenAI-compatible provider to understand existing patterns:

  16. Assistant

    Now let me check if DeepSeek currently has any special handling in the codebase. Let me search for DeepSeek in the thinking-related code:

  17. Assistant

    Let me check what tests already exist for DeepSeek and thinking:

  18. Assistant

    Now let me check if DeepSeek currently has any handling in the thinkingControlKind function:

  19. Assistant

    Let me check if there's a SupportsThinking method in the HTTP provider:

  20. Assistant

    Let me look at how providers are created in the factory:

  21. Assistant

    Let me look at the factory_provider.go to understand how DeepSeek is created:

  22. Assistant

    Let me look at the factory creation for the deepseek case:

  23. Assistant

    Now let me look at how thinking_level is applied in the agent to understand the full flow:

  24. Assistant

    Now I have a good understanding of the codebase. Let me check if there are any existing tests for DeepSeek thinking control:

  25. Assistant

    Now I understand the full picture. Let me create a plan and implement the changes:

    1. Update thinkingControlKind to include DeepSeek as "deepseek_thinking"
    2. Update applyThinkingControl to handle all thinking levels for DeepSeek (not just "off")
    3. Add SupportsThinking to HTTPProvider so the agent knows DeepSeek supports thinking
    4. Add tests for DeepSeek thinking mapping

    Let me start by implementing the changes:

  26. Assistant

    Let me also check the applyThinkingControl function more closely:

  27. Assistant

    Now I understand the full picture. Let me implement the changes step by step.

    Step 1: Add DeepSeek to thinkingControlKind

  28. Assistant

    Now I'll modify the thinkingControlKind function to add DeepSeek support:

  29. Assistant

    Let me check if there's already an isDeepSeekHost function:

  30. Assistant

    Good, there's already an isDeepSeekHost function. Let me see what it does:

  31. Assistant

    Now I'll update the thinkingControlKind function in the actual file:

  32. Assistant

    Let me use the edit command to replace the function:

  33. Assistant

    Let me check what the file looks like now:

  34. Assistant

    I accidentally deleted too much. Let me restore the file from git:

  35. Assistant

    Now let me use the edit command to make targeted changes. First, let me open the file:

  36. Assistant

    Let me find the exact line numbers for the functions I need to modify:

  37. Assistant

    Let me find where the function ends:

  38. Assistant

    Now I'll use the edit command to replace the function:

  39. Assistant

    Now I need to update the applyThinkingControl function to handle all thinking levels for DeepSeek. Let me look at the current function:

  40. Assistant

    Now I'll update the applyThinkingControl function to handle all thinking levels for DeepSeek:

  41. Assistant

    Now I need to add SupportsThinking to HTTPProvider so the agent knows DeepSeek supports thinking. Let me look at the current HTTPProvider:

  42. Assistant

    Now I need to add a SupportsThinking method to HTTPProvider. Let me check if there's a way to get the provider name from the delegate:

  43. Assistant

    I need to add a method to the openai_compat provider to expose thinking support, then delegate from HTTPProvider. Let me add the method:

  44. Assistant

    Let me add a SupportsThinking method to the openai_compat provider near the end of the file:

  45. Assistant

    Let me look at the applyThinkingOption function more carefully:

  46. Assistant

    Let me see more of this function:

  47. Assistant

    Let me check how the provider is used in the factory and what the ThinkingCapable interface looks like:

  48. Assistant

    Now I need to add a SupportsThinking method. Let me add it to the openai_compat provider first:

  49. Assistant

    I'll add a SupportsThinking method after SupportsNativeSearch:

  50. Assistant

    I see there's an issue - I accidentally replaced the closing brace of SupportsNativeSearch. Let me fix that:

  51. Assistant

    Let me try again more carefully. First, let me restore and open the file:

  52. Assistant

    Let me try a more careful approach. First, let me find the exact line numbers again:

  53. Assistant

    Let me see what's around line 794:

  54. Assistant

    Now I'll add the SupportsThinking method after SupportsNativeSearch. I'll insert it between lines 796 and 797:

  55. Assistant

    I see there's still an issue - there's no blank line between the SupportsNativeSearch function and the new SupportsThinking function. Let me fix that:

  56. Assistant

    I see there's still an issue - there's no blank line between the SupportsThinking function and the isNativeOpenAIOrAzureEndpoint function. Let me fix that:

  57. Assistant

    Wait, there's a problem with my SupportsThinking implementation. The thinkingControlKind method takes a model parameter, but I'm calling it with an empty string. This means it will check the provider name, but for some providers (like "modelscope"), the thinking control kind depends on the model. Let me fix this:

  58. Assistant

    Now I need to update the applyThinkingControl function and the thinkingControlKind function. Let me do that now:

  59. Assistant

    Let me update the applyThinkingControl function:

  60. Assistant

    Now I need to update the thinkingControlKind function to add DeepSeek support. Let me do that:

  61. Assistant

    Now I need to add SupportsThinking to the HTTPProvider. Let me update the HTTPProvider file:

  62. Assistant

    Now I need to add a SupportsThinking method to the HTTPProvider. Let me add it after the SupportsNativeSearch method:

  63. Assistant

    Now I need to add a SupportsThinking method. Let me add it after the SupportsNativeSearch method:

  64. Assistant

    Now let me also check the tool_schema_transform.go wrapper:

  65. Assistant

    Good, the tool_schema_transform.go already has a SupportsThinking method that delegates to the underlying provider. This will automatically work with our changes.

    Now let me run the tests to see if everything works:

  66. Assistant

    Let me set up the environment and run the tests:

  67. Assistant

    Let me continue to see all tests:

  68. Assistant

    All tests pass. Now let me add tests for DeepSeek thinking mapping. Let me add them to the test file:

  69. Assistant

    Let me find where to add the DeepSeek thinking tests. Let me look for existing thinking tests:

  70. Assistant

    Let me look at what's after the existing thinking tests:

  71. Assistant

    Now I'll add DeepSeek thinking tests after line 126. Let me add tests for all thinking levels:

  72. Assistant

    I notice there's a missing blank line after line 126. Let me fix that:

  73. Assistant

    Good, now let me run the tests to see if they pass:

  74. Assistant

    Excellent! All the DeepSeek thinking tests pass. Now let me run all the tests to make sure I didn't break anything:

  75. Assistant

    All tests pass. Now let me run the tests for the httpapi package as well:

  76. Assistant

    All tests pass. Now let me also run the agent tests to make sure the thinking logic works correctly:

  77. Assistant

    Let me check if there are any tests related to thinking in the agent package:

  78. Assistant

    Let me check what tests exist in the agent package:

  79. Assistant

    Let me run the thinking-related tests in the agent package:

  80. Assistant

    Let me try running all tests in the agent package:

  81. Assistant

    All tests pass. Now let me also run the factory provider tests to make sure everything works:

  82. Assistant

    Let me check if there are any tests in the providers package that might be affected:

  83. Assistant

    All tests pass. Now let me add a test to verify that the SupportsThinking method works correctly for DeepSeek:

  84. Assistant

    Let me add tests for SupportsThinking after the SupportsNativeSearch tests:

  85. Assistant

    Let me add tests for SupportsThinking after line 2000:

  86. Assistant

    I see there's a missing blank line before the TestProviderChat_NativeSearchToolInjected test. Let me fix that:

  87. Assistant

    Now let me run all the tests again to make sure everything passes:

  88. Assistant

    All tests pass. Now let me run the agent tests again to make sure everything works:

  89. Assistant

    All tests pass. Now let me also check the applyThinkingOption function in the agent to make sure it will work correctly with our changes. Let me also check if there are any edge cases I need to handle:

  90. Assistant

    Let me check if there are any other wrappers that might need updating:

  91. Assistant

    Let me check the tool_schema_transform.go to make sure it delegates correctly:

  92. Assistant

    Good, the tool_schema_transform.go already delegates correctly. Let me now run the factory provider tests to make sure everything works:

  93. Assistant

    All tests pass. Let me also run the factory provider tests:

  94. Assistant

    The factory_provider_test.go build failure is pre-existing and not related to my changes. Let me verify by running the tests properly:

  95. Assistant

    All tests pass. Let me now verify the code compiles correctly:

  96. Assistant

    Let me wait for the build to complete:

  97. Assistant

    The build error is not related to my changes - it's about a missing workspace directory. Let me check if there's a workspace directory:

  98. Assistant

    The build error is not related to my changes. Let me just run the tests for the specific packages I modified:

  99. Assistant

    All tests pass. Let me now review the changes I made and create a summary. Let me check the git status:

  100. Assistant

    Let me view the changes I made:

  101. Assistant

    I notice there's a missing blank line. Let me fix that:

  102. Assistant

    Let me find the missing blank line. Let me look at around line 234-240:

  103. Assistant

    I see there's a missing blank line between line 238 and 239. Let me fix that:

  104. Assistant

    Good, now the blank line is fixed. Let me run the tests one more time to make sure everything passes:

  105. Assistant

    Let me try a different approach to run the tests:

  106. Assistant

    All tests pass. Let me now run all tests one more time to make sure everything is working correctly:

  107. Assistant

    All tests pass. Let me now review the checklist from the issue description:

    Checklist

    1. If an error was reported in the issue description, I have successfully reproduced it.

    Not applicable - This is a feature request, not an error report. The issue asks for DeepSeek thinking mapping to be implemented.

    2. If an error was reported in the issue description, I have confirmed that my fix resolves the error.

    Not applicable - Same as above.

    3. I have thought about edge cases and made sure my fix handles them as well.

    Yes - I considered:

    • DeepSeek provider name detection
    • DeepSeek API base host detection
    • All thinking levels (off, low, medium, high, xhigh, adaptive)
    • The agent's applyThinkingOption function behavior
    • Wrappers like tool_schema_transform that delegate to the underlying provider

    4. I have run existing tests in the repository that might have been affected by the change I made and confirmed that they pass.

    Yes - I ran:

    • go test ./pkg/providers/openai_compat/ - All tests pass
    • go test ./pkg/providers/httpapi/ - All tests pass
    • go test ./pkg/agent/ - All tests pass
    • go test ./pkg/providers/... - All tests pass

    The changes I made are complete and all tests pass. Let me submit the changes:

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