MCPcopy
hub / github.com/OpenCoworkAI/open-codesign / runMatrix

Function runMatrix

scripts/smoke-models.ts:311–340  ·  view source on GitHub ↗
(
  models: SmokeModel[],
  prompts: SmokePrompt[],
  onlyKeys: Set<string> | null,
)

Source from the content-addressed store, hash-verified

309}
310
311async function runMatrix(
312 models: SmokeModel[],
313 prompts: SmokePrompt[],
314 onlyKeys: Set<string> | null,
315): Promise<RunResult[]> {
316 const results: RunResult[] = [];
317 for (const m of models) {
318 const envName = ENV_KEY[m.provider];
319 if (!envName) {
320 throw new Error(
321 `Unsupported provider in smoke config: ${m.provider}. Add it to ENV_KEY or fix scripts/smoke-models.toml.`,
322 );
323 }
324
325 const apiKey = process.env[envName];
326 if (!apiKey) {
327 console.log(
328 `${COLOR.dim}— ${m.provider}/${m.modelId} (no $${envName}; skipped)${COLOR.reset}`,
329 );
330 continue;
331 }
332 for (const p of prompts) {
333 if (onlyKeys && !onlyKeys.has(`${m.provider}/${m.modelId}|${p.name}`)) continue;
334 const r = await runOne(m, p, apiKey);
335 printResult(r);
336 results.push(r);
337 }
338 }
339 return results;
340}
341
342function printSummary(results: RunResult[]): void {
343 const passed = results.filter((r) => r.ok).length;

Callers 1

mainFunction · 0.85

Calls 2

runOneFunction · 0.85
printResultFunction · 0.85

Tested by

no test coverage detected