Open History to see the last commit
1import { describe, expect, it } from 'vitest'
2import { codexReasoningEffort } from '../src/adapters/text'
3
4describe('Codex chat({ reasoning }) effort', () => {
5 it('uses the model effort for the level', () => {
6 expect(
7 codexReasoningEffort(
8 'gpt-5.2-codex',
9 { level: 'xhigh', summary: true },
10 undefined,
11 ),
12 ).toBe('xhigh')
13 })
14
15 it('clamps a level the model does not have', () => {
16 // gpt-5.1-codex has no minimal: it clamps up to low.
17 expect(
18 codexReasoningEffort(
19 'gpt-5.1-codex',
20 { level: 'minimal', summary: true },
21 undefined,
22 ),
23 ).toBe('low')
24 })
25
26 it('falls back to the adapter default without a request', () => {
27 expect(codexReasoningEffort('gpt-5.1-codex', undefined, 'high')).toBe(
28 'high',
29 )
30 expect(
31 codexReasoningEffort('gpt-5.1-codex', undefined, undefined),
32 ).toBeUndefined()
33 })
34})