MCPcopy Index your code
hub / github.com/CodebuffAI/codebuff / formatTaskResults

Function formatTaskResults

evals/buffbench/format-output.ts:23–73  ·  view source on GitHub ↗
({
  commit,
  taskNumber,
  totalTasks,
  agentResults,
  traceAnalysis,
}: {
  commit: EvalCommitV2
  taskNumber: number
  totalTasks: number
  agentResults: AgentResultData[]
  traceAnalysis?: TraceAnalysisData
})

Source from the content-addressed store, hash-verified

21}
22
23export function formatTaskResults({
24 commit,
25 taskNumber,
26 totalTasks,
27 agentResults,
28 traceAnalysis,
29}: {
30 commit: EvalCommitV2
31 taskNumber: number
32 totalTasks: number
33 agentResults: AgentResultData[]
34 traceAnalysis?: TraceAnalysisData
35}): string {
36 const separator = '='.repeat(80)
37 const minorSeparator = '-'.repeat(80)
38 const lines: string[] = [
39 '',
40 separator,
41 `RESULTS FOR TASK ${taskNumber}/${totalTasks}: ${commit.id} (${commit.sha.slice(0, 7)})`,
42 separator,
43 '',
44 'TASK:',
45 minorSeparator,
46 commit.prompt,
47 '',
48 ]
49
50 // Print each agent's results
51 agentResults.forEach((result, index) => {
52 lines.push(
53 formatAgentResult({
54 ...result,
55 commit,
56 agentNumber: index + 1,
57 totalAgents: agentResults.length,
58 }),
59 )
60 })
61
62 // Add trace analysis if provided
63 if (traceAnalysis) {
64 lines.push(
65 formatTraceAnalysis({
66 commit,
67 ...traceAnalysis,
68 }),
69 )
70 }
71
72 return lines.join('\n')
73}
74
75export function formatAgentResult(params: {
76 agentId: string

Callers 1

runTaskFunction · 0.90

Calls 2

formatAgentResultFunction · 0.85
formatTraceAnalysisFunction · 0.85

Tested by

no test coverage detected