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

Function renderBenchmarkRun

plugins/plugin-eval/src/renderers/markdown.js:544–599  ·  view source on GitHub ↗
(payload)

Source from the content-addressed store, hash-verified

542}
543
544function renderBenchmarkRun(payload) {
545 const benchmarkPayload = ensureBenchmarkRunPayload(payload);
546
547 return [
548 `# Benchmark Run: ${benchmarkPayload.target.name}`,
549 "",
550 section("At a Glance", [
551 `- Mode: ${benchmarkPayload.mode}`,
552 `- Codex version: ${benchmarkPayload.codexVersion}`,
553 `- Scenarios: ${benchmarkPayload.config.scenarioCount}`,
554 `- Model: ${benchmarkPayload.config.model}`,
555 `- Workspace source: \`${benchmarkPayload.config.workspaceSourcePath}\``,
556 `- Setup mode: ${benchmarkPayload.config.workspaceSetupMode}`,
557 `- Preserve policy: ${benchmarkPayload.config.workspacePreserve}`,
558 ...(benchmarkPayload.usageLogPath ? [`- Usage log: \`${benchmarkPayload.usageLogPath}\``] : []),
559 `- Run directory: \`${benchmarkPayload.runDirectory}\``,
560 `- Usage availability: ${benchmarkPayload.summary.usageAvailability}`,
561 `- Average input tokens: ${benchmarkPayload.summary.averageInputTokens}`,
562 `- Average output tokens: ${benchmarkPayload.summary.averageOutputTokens}`,
563 `- Average total tokens: ${benchmarkPayload.summary.averageTotalTokens}`,
564 `- Tool calls: ${benchmarkPayload.summary.toolCallCount}`,
565 `- Shell commands: ${benchmarkPayload.summary.shellCommandCount}`,
566 `- Failed shell commands: ${benchmarkPayload.summary.failedShellCommands}`,
567 `- Generated files: ${benchmarkPayload.summary.generatedFileCount}`,
568 `- Generated tests: ${benchmarkPayload.summary.generatedTestFileCount}`,
569 ]),
570 "",
571 section("Why It Matters", [
572 "- Benchmarking now runs real `codex exec` sessions in isolated workspaces instead of simulating the skill or plugin through a single API request.",
573 `- Completed scenarios: ${benchmarkPayload.summary.completedScenarios}/${benchmarkPayload.summary.scenarioCount}`,
574 `- Usage samples collected: ${benchmarkPayload.summary.sampleCount}`,
575 ]),
576 "",
577 section(
578 "Fix First",
579 benchmarkPayload.summary.failedScenarios > 0
580 ? ["- At least one scenario failed. Inspect the scenario logs and any preserved workspace before trusting the benchmark."]
581 : benchmarkPayload.summary.usageAvailability === "unavailable"
582 ? ["- No usage telemetry was emitted, so treat workspace outcomes and verifier results as the primary benchmark signal."]
583 : ["- Re-run analysis with the usage log before you start optimizing the skill or plugin."],
584 ),
585 "",
586 section("Recommended Next Step", renderNextAction(benchmarkPayload.nextAction)),
587 "",
588 section("Details", [
589 detailsBlock(
590 "Scenarios",
591 benchmarkPayload.scenarios
592 .map((scenario) => renderBenchmarkScenario(scenario, benchmarkPayload.mode))
593 .join("\n\n"),
594 ),
595 detailsBlock("Workflow follow-up", benchmarkPayload.nextSteps.map((item) => `- ${item}`).join("\n")),
596 detailsBlock("Use From Codex Chat", renderWorkflowGuide(benchmarkPayload.workflowGuide)),
597 ]),
598 ].join("\n");
599}
600
601function renderComparison(payload) {

Callers 1

renderMarkdownFunction · 0.85

Calls 7

detailsBlockFunction · 0.85
renderBenchmarkScenarioFunction · 0.85
mapMethod · 0.80
sectionFunction · 0.70
renderNextActionFunction · 0.70
renderWorkflowGuideFunction · 0.70

Tested by

no test coverage detected