()
| 8 | import type { AgentEvalResults } from './types' |
| 9 | |
| 10 | async function main() { |
| 11 | const saveTraces = process.argv.includes('--save-traces') |
| 12 | |
| 13 | console.log('Starting nightly buffbench evaluation...') |
| 14 | console.log('Eval set: codebuff') |
| 15 | console.log() |
| 16 | |
| 17 | const results = await runBuffBench({ |
| 18 | evalDataPaths: [ path.join(__dirname, 'eval-codebuff.json')], |
| 19 | agents: ['base2-free'], |
| 20 | taskConcurrency: 5, |
| 21 | saveTraces, |
| 22 | }) |
| 23 | |
| 24 | console.log('\nNightly buffbench evaluation completed successfully!') |
| 25 | |
| 26 | // Send email with results |
| 27 | const recipientEmail = process.env.EVAL_RESULTS_EMAIL || 'team@codebuff.com' |
| 28 | console.log(`\n📧 Sending buffbench results email to ${recipientEmail}...`) |
| 29 | |
| 30 | const { metadata, metaAnalysis, ...agentResults } = results |
| 31 | const emailContent = formatBuffBenchEmailContent( |
| 32 | agentResults, |
| 33 | metadata, |
| 34 | metaAnalysis, |
| 35 | ) |
| 36 | |
| 37 | try { |
| 38 | const emailResult = await sendBasicEmail({ |
| 39 | email: recipientEmail, |
| 40 | data: emailContent, |
| 41 | logger: console, |
| 42 | }) |
| 43 | |
| 44 | if (emailResult.success) { |
| 45 | console.log('✅ BuffBench results email sent successfully!') |
| 46 | } else { |
| 47 | console.log('⚠️ Email sending was skipped (likely missing configuration)') |
| 48 | } |
| 49 | } catch (emailError) { |
| 50 | console.error('❌ Failed to send buffbench results email:', emailError) |
| 51 | } |
| 52 | |
| 53 | process.exit(0) |
| 54 | } |
| 55 | |
| 56 | function formatBuffBenchEmailContent( |
| 57 | results: Record<string, AgentEvalResults>, |
no test coverage detected