feat(provider): add none variant that disables thinking for DeepSeek V4 - #46181
Open
tanishqvec wants to merge 1 commit into
Open
feat(provider): add none variant that disables thinking for DeepSeek V4#46181tanishqvec wants to merge 1 commit into
tanishqvec wants to merge 1 commit into
Conversation
This was referenced Aug 29, 2026
Contributor
|
The following comment was made by an LLM, it may be inaccurate: Based on my search, I found one related PR: Related PR:
This is not a duplicate but rather a related/predecessor PR that addresses the same issue with a different approach. The current PR provides a more nuanced solution that works correctly for multiple providers. |
Contributor
|
Thanks for updating your PR! It now meets our contributing guidelines. 👍 |
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.
Issue for this PR
Closes #46178
Type of change
What does this PR do?
reasoningVariantsreturns as soon as it finds an effort entry, so for any model that declares both a toggle and effort values the toggle is silently dropped. models.dev declares both fordeepseek-v4-*, so--variant nonewas accepted but did nothing — the model still returned reasoning. That early return is also non-undefined, so thereasoningVariants(model, base) ?? variants(base)fallback atprovider.ts:1310never runs for these models either.This keeps the toggle's
nonevariant alongside the effort variants, and sends the switch each provider actually honours. Zen ignoresthinking(eventhinking: "nonsense"returns 200) but acceptsreasoning_effort: "none"; api.deepseek.com is the reverse — its docs disable thinking with{"thinking": {"type": "disabled"}}and listreasoning_effortaslow|high|maxonly.The effort branch deliberately returns a plain object rather than going through
nonEmptyVariants, because the existing "does not replace unsupported effort options with heuristic variants" test relies on{}being returned to block the fallback. Scoping followstopP()attransform.ts:555rather than matching on model id, since around 30 other providers resell these models over openai-compatible and may accept neither switch.How did you verify your code works?
Ran
opencode run --model opencode/deepseek-v4-flash --variant none --format json --thinking -- "What is 17*23? Answer with just the number."against this branch and against unpatcheddev.Before: a
{"type":"reasoning","part":{"text":"The user is asking for the product of 17 and 23. Let me calculate: 17 * 23 = 391."}}part is still emitted. After: no reasoning part is emitted. Control on the patched build with the default variant still emits one, so the variant is what changes the behaviour.I could not exercise api.deepseek.com directly — that account has no balance — so the official-provider payload comes from https://api-docs.deepseek.com/guides/thinking_mode rather than a live response.
Tests:
bun test test/provider/transform.test.ts429 pass (3 new),bun test test/provider/provider.test.ts102 pass,bun typecheckclean, all frompackages/opencode.Screenshots / recordings
Not a UI change.
Checklist