Skip to content
Source
Sign inSign up
TanStack/ai
Open History to see the last commit

reasoning-options.test.ts

33 lines1.1 KB

1import { describe, expect, it } from 'vitest'
2import { claudeCodeReasoning } from '../src/adapters/text'
3​
4describe('Claude Code chat({ reasoning }) CLI settings', () => {
5 it('effort models: --effort with the level', () => {
6 expect(
7 claudeCodeReasoning('claude-opus-4-8', { level: 'xhigh', summary: true }),
8 ).toEqual({ args: ['--effort', 'xhigh'], env: {} })
9 // claude-opus-4-8 has no minimal: it clamps up to low.
10 expect(
11 claudeCodeReasoning('opus', { level: 'minimal', summary: true }).args,
12 ).toEqual(['--effort', 'low'])
13 })
14​
15 it('budget models: MAX_THINKING_TOKENS, 0 for off', () => {
16 expect(
17 claudeCodeReasoning('claude-haiku-4-5', {
18 level: 'medium',
19 summary: true,
20 }),
21 ).toEqual({ args: [], env: { MAX_THINKING_TOKENS: '8192' } })
22 expect(
23 claudeCodeReasoning('haiku', { level: 'off', summary: true }).env,
24 ).toEqual({ MAX_THINKING_TOKENS: '0' })
25 })
26​
27 it('sends nothing without a request', () => {
28 expect(claudeCodeReasoning('opus', undefined)).toEqual({
29 args: [],
30 env: {},
31 })
32 })
33})