Skip to content
Source
Sign inSign up
TanStack/schemas

DeepSeek: mandatory false from each model's own non-thinking bullet (#323 item 2) #420

Mergedtombeckenhammerged 2 commits intomain fromfix/323-deepseek-mandatorymerged by tombeckenham View on GitHub

Showing 3 changed files with 91 additions and 3 deletions.

x
0 of 3 viewed, 3 left
43 additions and 0 deletionssrc/server/providers/adapters/deepseek.test.tsModified
View file
@@ -124,6 +124,9 @@
mandatory: null,
efforts: ['high', 'max'],
+ // A guide that names no model's non-thinking mode changed shape: the
+ // stored `mandatory` is kept rather than overwritten with null.
+ expect(model?.absent?.reasoning).toBe('unavailable')
expect(model?.capabilities).toEqual(
expect.arrayContaining(['tools', 'reasoning']),
@@ -141,6 +144,45 @@
​
+it('reads mandatory false only for a model whose own top_p bullet names its non-thinking mode', async () => {
+ // Shape of https://api-docs.deepseek.com/guides/thinking_mode/ (2026-10-22).
+ const guide = `${DEEPSEEK_REPLAY_FIXTURE}
+ <p>Thinking mode does not support the temperature parameter. top_p behavior depends on the model:</p>
+ <ul><li><code>deepseek-v4-pro</code>: in thinking mode your value is ignored; in non-thinking mode it takes effect.</li></ul>`
+ const original = globalThis.fetch
+ globalThis.fetch = ((url: string) => {
+ if (String(url) === DEEPSEEK_THINKING_URL)
+ return Promise.resolve(new Response(guide))
+ if (String(url).includes('api-docs.deepseek.com'))
+ return Promise.resolve(new Response('MODEL\nPRICING\nConcurrency'))