Skip to content

Commit 563a17a

Browse files
committed
fix(bench): init OpenCode client before scoring baseline
`scoreBaseline()` called `matchTruthFinding()` which invokes `sendPrompt()` — but unlike `runScorer()`, `scoreBaseline()` never called `initOpenCodeClient()` first. Result: every run exited with [bench] ERROR: OpenCode client not initialized. Call initOpenCodeClient() first. regardless of whether baseline and truth data were present. Call `initOpenCodeClient(config.model)` at the top of `scoreBaseline()` so the two scoring paths have equivalent init behavior.
1 parent d6a8642 commit 563a17a

1 file changed

Lines changed: 6 additions & 0 deletions

File tree

packages/bench/src/scorer/baseline-scorer.ts

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
import type { ScaBenchBaseline, ScoringMetadata, VigiloFinding, ScorerMatch } from "../types.js";
22
import type { ScorerConfig } from "../utils.js";
33
import { matchTruthFinding } from "./llm-scorer.js";
4+
import { initOpenCodeClient } from "../client/opencode.js";
45
import { log } from "../utils.js";
56
import pc from "picocolors";
67

@@ -57,6 +58,11 @@ export async function scoreBaseline(
5758
log(pc.dim(`Truth findings: ${truthFindings.length}`));
5859
}
5960

61+
// runScorer() initializes the OpenCode client; scoreBaseline() skipped it
62+
// historically, which surfaced only as "client not initialized" on first
63+
// sendPrompt(). Initialize explicitly so the two paths behave the same.
64+
await initOpenCodeClient(config.model);
65+
6066
// Convert baseline findings to VigiloFinding format
6167
const workingSet: WorkingFinding[] = baseline.findings.map((f, idx) => ({
6268
id: f.id,

0 commit comments

Comments
 (0)