mirror of
https://github.com/tiennm99/ccs.git
synced 2026-10-16 22:14:21 +00:00
fix(thinking): harden codex reasoning controls across cli and dashboard
This commit is contained in:
1 parent
c48ed2ea7f
commit
92e2ec111d
16 files changed
+860
-146
No files matched your search
@@ -0,0 +1,43 @@
|
||||
import { describe, expect, it } from 'bun:test';
|
||||
import {
|
||||
parseThinkingCommandArgs,
|
||||
parseThinkingOverrideInput,
|
||||
} from '../../../src/commands/config-thinking-command';
|
||||
|
||||
describe('config thinking command parser', () => {
|
||||
it('rejects missing required option values', () => {
|
||||
const result = parseThinkingCommandArgs(['--mode']);
|
||||
expect(result.error).toBe('--mode requires a value');
|
||||
});
|
||||
|
||||
it('rejects unknown options', () => {
|
||||
const result = parseThinkingCommandArgs(['--unknown-flag']);
|
||||
expect(result.error).toBe('Unknown option: --unknown-flag');
|
||||
});
|
||||
|
||||
it('parses clear-provider-override with optional tier', () => {
|
||||
const withTier = parseThinkingCommandArgs(['--clear-provider-override', 'codex', 'opus']);
|
||||
expect(withTier.error).toBeUndefined();
|
||||
expect(withTier.options.clearProviderOverride).toEqual({ provider: 'codex', tier: 'opus' });
|
||||
|
||||
const withoutTier = parseThinkingCommandArgs(['--clear-provider-override', 'codex']);
|
||||
expect(withoutTier.error).toBeUndefined();
|
||||
expect(withoutTier.options.clearProviderOverride).toEqual({ provider: 'codex', tier: undefined });
|
||||
});
|
||||
});
|
||||
|
||||
describe('config thinking override normalization', () => {
|
||||
it('normalizes off aliases and case', () => {
|
||||
expect(parseThinkingOverrideInput('OFF')).toEqual({ value: 'off' });
|
||||
expect(parseThinkingOverrideInput('0')).toEqual({ value: 'off' });
|
||||
});
|
||||
|
||||
it('accepts valid levels', () => {
|
||||
expect(parseThinkingOverrideInput('High')).toEqual({ value: 'high' });
|
||||
});
|
||||
|
||||
it('validates numeric bounds', () => {
|
||||
expect(parseThinkingOverrideInput('100001').error).toContain('between 0 and 100000');
|
||||
expect(parseThinkingOverrideInput('8192')).toEqual({ value: 8192 });
|
||||
});
|
||||
});
|
||||
Reference in new issue
Block a user