refactor: centralize TEST_MODELS and DEFAULT_PRESETS in constants.js

- Move TEST_MODELS and DEFAULT_PRESETS to src/constants.js as single source of truth
- Update test-models.cjs helper to use dynamic import from constants
- Make getTestModels() and getModels() async functions
- Update all test files to await async model config loading
- Remove duplicate THINKING_MODELS and getThinkingModels() from test helper
- Make thinking tests more lenient for Gemini (doesn't always produce thinking blocks)

Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
Badri Narayanan S
2026-01-13 19:20:57 +05:30
parent 1a06098ae4
commit 12d196f6a0
11 changed files with 96 additions and 92 deletions

View File

@@ -9,6 +9,7 @@ import fs from 'fs/promises';
import path from 'path';
import os from 'os';
import { logger } from './logger.js';
import { DEFAULT_PRESETS } from '../constants.js';
/**
* Get the path to the global Claude CLI settings file
@@ -143,38 +144,6 @@ function isObject(item) {
// Claude CLI Presets
// ==========================================
/**
* Default presets based on README examples
*/
const DEFAULT_PRESETS = [
{
name: 'Claude Thinking',
config: {
ANTHROPIC_AUTH_TOKEN: 'test',
ANTHROPIC_BASE_URL: 'http://localhost:8080',
ANTHROPIC_MODEL: 'claude-opus-4-5-thinking',
ANTHROPIC_DEFAULT_OPUS_MODEL: 'claude-opus-4-5-thinking',
ANTHROPIC_DEFAULT_SONNET_MODEL: 'claude-sonnet-4-5-thinking',
ANTHROPIC_DEFAULT_HAIKU_MODEL: 'gemini-2.5-flash-lite[1m]',
CLAUDE_CODE_SUBAGENT_MODEL: 'claude-sonnet-4-5-thinking',
ENABLE_EXPERIMENTAL_MCP_CLI: 'true'
}
},
{
name: 'Gemini 1M',
config: {
ANTHROPIC_AUTH_TOKEN: 'test',
ANTHROPIC_BASE_URL: 'http://localhost:8080',
ANTHROPIC_MODEL: 'gemini-3-pro-high[1m]',
ANTHROPIC_DEFAULT_OPUS_MODEL: 'gemini-3-pro-high[1m]',
ANTHROPIC_DEFAULT_SONNET_MODEL: 'gemini-3-flash[1m]',
ANTHROPIC_DEFAULT_HAIKU_MODEL: 'gemini-2.5-flash-lite[1m]',
CLAUDE_CODE_SUBAGENT_MODEL: 'gemini-3-flash[1m]',
ENABLE_EXPERIMENTAL_MCP_CLI: 'true'
}
}
];
/**
* Get the path to the presets file
* @returns {string} Absolute path to claude-presets.json