Skip to content

Commit 4b2b83b

Browse files
committed
log codebuff output errors
1 parent 8196537 commit 4b2b83b

File tree

1 file changed

+25
-0
lines changed

1 file changed

+25
-0
lines changed

evals/buffbench/runners/codebuff.ts

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -90,6 +90,31 @@ export class CodebuffRunner implements Runner {
9090
},
9191
})
9292

93+
if (result.output.type === 'error') {
94+
console.error(
95+
`[${this.commitId}:${this.agentId}] Error:`,
96+
result.output.message,
97+
)
98+
if (DEBUG_ERROR) {
99+
// Save errors in a file, but not tool calls with invalid json.
100+
fs.writeFileSync(
101+
path.join(
102+
__dirname,
103+
'..',
104+
`${this.commitId}-${this.agentId}-error-${Math.random().toString(36).substring(2, 6)}.json`,
105+
),
106+
JSON.stringify(
107+
{
108+
...result.output,
109+
trace: steps,
110+
},
111+
null,
112+
2,
113+
),
114+
)
115+
}
116+
}
117+
93118
totalCostUsd = (result.sessionState?.mainAgentState.creditsUsed ?? 0) / 100
94119

95120
// Get git diff after Codebuff has made changes

0 commit comments

Comments
 (0)