feat(providers): support deepseek native api reasoning_#21052
Open
WuTianyi123 wants to merge 1 commit into
Open
feat(providers): support deepseek native api reasoning_#21052WuTianyi123 wants to merge 1 commit into
WuTianyi123 wants to merge 1 commit into
Conversation
DeepSeek's native API accepts top-level reasoning_effort (high/max),
not extra_body.reasoning. Previously the DeepSeek profile used the
base ProviderProfile which returned ({}, {}) for build_api_kwargs_extras,
so reasoning_effort config was silently ignored when using the DeepSeek
native provider (api.deepseek.com).
Changes:
- Add 'max' to VALID_REASONING_EFFORTS in hermes_constants.py
- DeepSeekProfile overrides build_api_kwargs_extras to emit
reasoning_effort as top-level param with value mapping:
low/medium/minimal → high, xhigh/max → max
- Summary path in run_agent.py handles deepseek top-level
reasoning_effort (like LM Studio), bypassing extra_body.reasoning
- Update UI help texts and config example comments to include 'max'
Tests: 7 new transport parity tests in TestDeepSeekParity.
All existing tests pass.
This was referenced May 8, 2026
2 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What does this PR do?
Fix
reasoning_effortbeing silently ignored when using the DeepSeeknative provider (
api.deepseek.com). Two issues:reasoning_effort(high/max),not
extra_body.reasoning. The baseProviderProfilereturns({}, {})for
build_api_kwargs_extras, so the config was never sent."max"was not inVALID_REASONING_EFFORTS— setting it causedUnknown reasoning_effort 'max', using default (medium).Related Issue
N/A (no existing issue)
Type of Change
Changes Made
hermes_constants.py: Add"max"toVALID_REASONING_EFFORTSplugins/model-providers/deepseek/__init__.py: NewDeepSeekProfileclasswith
build_api_kwargs_extrasemitting top-levelreasoning_effort,mapping:
low/medium/minimal→"high",xhigh/max→"max"run_agent.py: Summary path handles deepseek like LM Studio (top-levelreasoning_effort, notextra_body.reasoning)cli.py:/reasoninghelp text updatedcli-config.yaml.example: Options comment updatedbatch_runner.py: Docstring + valid_efforts list updatedtests/providers/test_transport_parity.py: 7 newTestDeepSeekParitytestsHow to Test
pytest tests/providers/test_transport_parity.py -q(26→33 tests, deepseekmapping coverage)
pytest tests/run_agent/test_run_agent.py -k reasoning -q(35 reasoning tests)pytest tests/providers/ -q(90 provider tests)reasoning_effort: xhighwithprovider: deepseek, verifyreasoning_effort: maxis sent in API requestChecklist
Code
pytest tests/ -qand all tests passDocumentation & Housekeeping
cli-config.yaml.example— config comment updatedScreenshots / Logs
Before (
reasoning_effort: xhighwithprovider: deepseek):_supports_reasoning_extra_body()returnedFalsereasoning_effortwas silently dropped from API requestAfter:
reasoning_effortas top-level paramxhigh→"max",medium→"high"(per DeepSeek API spec)