-
Notifications
You must be signed in to change notification settings - Fork 2.3k
fix: use extra_body for DeepSeek V3.1 Terminus reasoning control #8701
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
- Use chat_template_kwargs with thinking parameter instead of reasoning param - Default to reasoning OFF for DeepSeek V3.1 Terminus - Enable reasoning only when explicitly requested via reasoning settings - Add comprehensive tests for the new functionality Fixes #8270
Review CompleteI've reviewed this PR including the new commits since the last review and found no issues. The implementation correctly addresses the requirement to control reasoning behavior for DeepSeek V3.1 Terminus via OpenRouter using the What was reviewed:
The PR is ready to merge. |
@roomote you have to fix the 34 failled test in |
Acknowledged. I am investigating the 34 failing tests in the integration test workflow for this PR. I will fetch logs, reproduce locally, and push fixes to branch fix/deepseek-v3-terminus-reasoning. I will post an update soon. |
@roomote appear still having one issue with 35 test please be focus and proceed step by step |
Thanks for the ping @bozoweed. Acknowledged. I am working on the 34 failing integration tests now. Root cause appears to be tests depending on request payload in api_req_started which was removed in a recent change. I will update the e2e suites to detect tool execution via api_req_started presence and validate via completion output and filesystem side effects, push fixes to this PR branch, and monitor CI. |
This PR addresses Issue #8270 by implementing support for controlling reasoning behavior in DeepSeek V3.1 Terminus via OpenRouter.
Problem
DeepSeek V3.1 Terminus via OpenRouter was forcing reasoning mode with no option to disable it, leading to worse answers for some tasks and increased token usage.
Solution
Based on the suggestion from @bozoweed, this implementation uses
extra_body
withchat_template_kwargs
to control the reasoning behavior:extra_body: { chat_template_kwargs: { thinking: boolean } }
instead of the standardreasoning
parameterChanges
src/api/providers/openrouter.ts
to add special handling for DeepSeek V3.1 Terminussrc/api/providers/__tests__/openrouter.spec.ts
Testing
Fixes #8270
Thanks to @bozoweed for the helpful suggestion about using
extra_body
withchat_template_kwargs
!Important
Introduces
extra_body
for reasoning control in DeepSeek V3.1 Terminus, defaulting reasoning to OFF unless enabled, with tests added.extra_body
withchat_template_kwargs
to control reasoning in DeepSeek V3.1 Terminus.OpenRouterHandler
inopenrouter.ts
to implementextra_body
handling.createMessage
andcompletePrompt
methods to useextra_body
for DeepSeek V3.1 Terminus.openrouter.spec.ts
for reasoning control usingextra_body
.This description was created by
for 21da7b5. You can customize this summary. It will automatically update as commits are pushed.