MCPcopy Create free account
hub / github.com/openai/plugins / normalizeConfig

Function normalizeConfig

plugins/plugin-eval/src/core/benchmark.js:65–95  ·  view source on GitHub ↗
(config, target)

Source from the content-addressed store, hash-verified

63}
64
65function normalizeConfig(config, target) {
66 if (config?.schemaVersion === 1 || config?.harnessPrompt || config?.baseUrl || config?.apiKeyEnv) {
67 throw new Error(
68 "Legacy Responses-style benchmark configs are no longer supported. Re-run `plugin-eval init-benchmark <path>` to generate a CLI-only Codex benchmark config.",
69 );
70 }
71
72 if (!config || config.kind !== "plugin-eval-benchmark") {
73 throw new Error("Invalid benchmark config. Expected a plugin-eval benchmark config file.");
74 }
75
76 if (config.schemaVersion !== BENCHMARK_SCHEMA_VERSION) {
77 throw new Error(
78 `Unsupported benchmark schema version: ${config.schemaVersion}. Re-run \`plugin-eval init-benchmark ${formatCommandPath(target.path)}\` to regenerate the config.`,
79 );
80 }
81
82 if (config.runner?.type !== "codex-cli") {
83 throw new Error("Benchmark runner.type must be \"codex-cli\".");
84 }
85
86 if (!config.workspace?.sourcePath) {
87 throw new Error("Benchmark config must set workspace.sourcePath.");
88 }
89
90 if (!config.targetProvisioning?.mode) {
91 throw new Error("Benchmark config must set targetProvisioning.mode.");
92 }
93
94 return config;
95}
96
97function buildSetupQuestions(target) {
98 const label = target.kind === "plugin" ? "plugin" : "skill";

Callers 1

loadBenchmarkConfigFunction · 0.85

Calls 1

formatCommandPathFunction · 0.90

Tested by

no test coverage detected