Skip to content

feat(deepseek): enable native thinking mode via extra_body.thinking + provider profile#25000

Closed
tuobi2 wants to merge 1 commit into
NousResearch:mainfrom
tuobi2:feat/deepseek-native-thinking-mode
Closed

feat(deepseek): enable native thinking mode via extra_body.thinking + provider profile#25000
tuobi2 wants to merge 1 commit into
NousResearch:mainfrom
tuobi2:feat/deepseek-native-thinking-mode

Conversation

@tuobi2

@tuobi2 tuobi2 commented May 13, 2026

Copy link
Copy Markdown

Problem

DeepSeek's native Chat Completions API requires to return reasoning_content. Hermes already handled the response-side (reasoning_content placeholder fixes in bfb7046, #15478), but the request-side — sending extra_body.thinking to the API — was missing.

Kimi already had full thinking support via . DeepSeek was simply overlooked.

Changes

File Change
with (follows Kimi pattern)
Legacy-path fallback (parity with path)
detection + param forwarding
(3 tests)
(2 tests)

How it works

  1. Provider profile path (primary): emits when is true
  2. Legacy path (fallback): When the profile isnt loaded, the flag in handles it — same pattern as the existing path

Verification

… provider profile

DeepSeek's native Chat Completions API requires extra_body={'thinking':
{'type': 'enabled'}} to return reasoning_content. Before this, only the
response-side was handled (reasoning_content placeholder fixes in
bfb7046, NousResearch#15478), but the request-side was missing entirely.

Changes:
- plugins/model-providers/deepseek: DeepSeekProfile with
  build_api_kwargs_extras — follows the same pattern as KimiProfile
- agent/transports/chat_completions: legacy-path fallback for when
  the provider profile isn't loaded (parity with Kimi's path)
- run_agent.py: _is_deepseek detection + is_deepseek param forwarding

Tests:
- TestDeepSeekProfile (5 profile-level tests)
- TestDeepSeekParity (2 transport-level parity tests)

Closes the gap between Kimi (which already has full thinking support)
and DeepSeek (which only had response-side fixes).
@alt-glitch alt-glitch added type/feature New feature or request P3 Low — cosmetic, nice to have provider/deepseek DeepSeek API comp/agent Core agent loop, run_agent.py, prompt builder comp/plugins Plugin system and bundled plugins labels May 13, 2026
@alt-glitch

Copy link
Copy Markdown
Collaborator

Multiple competing PRs for DeepSeek thinking support already exist: #16448, #22218, #15577, #24130, #24225. Please coordinate with those authors or explain how this differs.

@tuobi2

tuobi2 commented May 13, 2026

Copy link
Copy Markdown
Author

Closing in favor of #22218 per @alt-glitch's consolidation guidance. Our approach is the same shape.

We have two incremental pieces that #22218 doesn't yet cover — offering them here for the author to incorporate if useful:

1. Transport-layer fallback (legacy-path parity with Kimi)

When fails or the profile isn't loaded, the Kimi path already has a transport-level flag (chat_completions.py L341-349). DeepSeek should have the same safety net. Diff:

2. Transport parity tests

— verifies that the correctly integrates (same pattern as existing ).

Both are in the diff at https://github.com/NousResearch/hermes-agent/pull/25000/files if the author wants to cherry-pick.

Thanks for the review @alt-glitch, and thanks @asdlem for the earlier PR — happy to help land this!

@tuobi2

tuobi2 commented May 13, 2026

Copy link
Copy Markdown
Author

Closed as duplicate of #22218. Our incremental pieces (transport-layer is_deepseek fallback + parity tests) offered to #22218 author for cherry-pick.

@tuobi2 tuobi2 closed this May 13, 2026
asdlem added a commit to asdlem/hermes-agent that referenced this pull request May 13, 2026
- run_agent.py: detect api.deepseek.com and forward is_deepseek param
  (mirrors existing is_kimi pattern)
- chat_completions.py: handle is_deepseek in extra_body.thinking
  (same protocol as Kimi — fallback when profile subsystem fails)
- tests: TestDeepSeekParity (transport) + TestDeepSeekProfile (profile)
  (5 tests, all passing)

Refs: NousResearch#22218, closes NousResearch#25000
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

comp/agent Core agent loop, run_agent.py, prompt builder comp/plugins Plugin system and bundled plugins P3 Low — cosmetic, nice to have provider/deepseek DeepSeek API type/feature New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants