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

@@ -13,7 +13,7 @@
* the anthropic-beta header which is specific to Claude thinking models.
*/
const { streamRequest, commonTools } = require('./helpers/http-client.cjs');
const { getThinkingModels, getModelConfig } = require('./helpers/test-models.cjs');
const { getTestModels, getModelConfig } = require('./helpers/test-models.cjs');
// Multiple tools to encourage interleaved thinking
const tools = [commonTools.readFile, commonTools.writeFile, commonTools.runTests];
@@ -172,7 +172,7 @@ Please do this step by step, reading each file before modifying.`
async function runTests() {
// Interleaved thinking is Claude-only (requires anthropic-beta header)
const models = getThinkingModels(['gemini']);
const models = await getTestModels(['gemini']);
let allPassed = true;
for (const { family, model } of models) {