1+ import { execSync } from 'child_process'
12import fs from 'fs'
2- import path from 'path'
33import os from 'os'
4- import { execSync } from 'child_process '
4+ import path from 'path '
55
66import { API_KEY_ENV_VAR } from '@codebuff/common/old-constants'
7+ import {
8+ CodebuffClient ,
9+ getUserCredentials ,
10+ loadLocalAgents ,
11+ } from '@codebuff/sdk'
712import pLimit from 'p-limit'
813
914import { runAgentOnCommit , type ExternalAgentType } from './agent-runner'
1015import { formatTaskResults } from './format-output'
1116import { judgeCommitResult } from './judge'
12- import { analyzeAgentTraces , type AgentTraceData } from './trace-analyzer'
1317import { extractAgentLessons , saveAgentLessons } from './lessons-extractor'
14- import { CodebuffClient , getUserCredentials , loadLocalAgents } from '@codebuff/sdk '
18+ import { analyzeAgentTraces , type AgentTraceData } from './trace-analyzer '
1519import { logger } from '../logger'
16- import type { AgentEvalResults , EvalDataV2 , EvalCommitV2 } from './types'
1720import { analyzeAllTasks } from './meta-analyzer'
1821
22+ import type { AgentEvalResults , EvalDataV2 , EvalCommitV2 } from './types'
23+
1924function parseAgentId ( agent : string ) : {
2025 agentId : string
2126 externalAgentType ?: ExternalAgentType
@@ -340,12 +345,12 @@ export async function runBuffBench(options: {
340345 ( f ) => f . data . binInstalls ?? [ ] ,
341346 )
342347 const uniqueBinInstalls = allBinInstalls . filter (
343- ( bin , index , self ) =>
344- index === self . findIndex ( ( b ) => b . name === bin . name ) ,
348+ ( bin , index , self ) => index === self . findIndex ( ( b ) => b . name === bin . name ) ,
345349 )
346350
347351 // Install binaries once at the beginning
348- const { tempDir : binsTempDir , env : binsEnv } = installBinaries ( uniqueBinInstalls )
352+ const { tempDir : binsTempDir , env : binsEnv } =
353+ installBinaries ( uniqueBinInstalls )
349354
350355 let commitsToRun : CommitWithSource [ ]
351356 if ( taskIds && taskIds . length > 0 ) {
@@ -362,7 +367,9 @@ export async function runBuffBench(options: {
362367 }
363368
364369 if ( notFoundIds . length > 0 ) {
365- const availableIds = allCommitsWithSource . map ( ( c ) => c . commit . id ) . join ( ', ' )
370+ const availableIds = allCommitsWithSource
371+ . map ( ( c ) => c . commit . id )
372+ . join ( ', ' )
366373 throw new Error (
367374 `Task ID(s) not found: ${ notFoundIds . join ( ', ' ) } . Available task IDs: ${ availableIds } ` ,
368375 )
@@ -473,7 +480,7 @@ export async function runBuffBench(options: {
473480 }
474481 }
475482
476- for ( const [ _agentId , agentData ] of Object . entries ( results ) ) {
483+ for ( const agentData of Object . values ( results ) ) {
477484 // Filter out runs from commits where ANY agent had an error
478485 const validRuns = agentData . runs . filter (
479486 ( r ) => ! commitShasWithErrors . has ( r . commitSha ) ,
0 commit comments