fix(benchmarks): address review feedback on error handling and validation
- headless.ts: emit error field on tool_result when output starts with Error: - test-multi-model.ts: errored/timed-out models now shown as RED and exit(1) - test-multi-model.ts: validate --timeout arg (reject NaN/negative) - test-edge-cases.ts: use exact match instead of trim() for whitespace test - test-edge-cases.ts: skip file pre-creation for create-via-append test Ultraworked with [Sisyphus](https://github.com/code-yeongyu/oh-my-opencode) Co-authored-by: Sisyphus <clio-agent@sisyphuslabs.ai>
This commit is contained in:
@@ -151,11 +151,14 @@ async function run() {
|
||||
model: modelId,
|
||||
})
|
||||
break
|
||||
case "tool-result":
|
||||
case "tool-result": {
|
||||
const output = typeof part.result === "string" ? part.result : JSON.stringify(part.result)
|
||||
const isError = typeof output === "string" && output.startsWith("Error:")
|
||||
emit({
|
||||
type: "tool_result",
|
||||
tool_call_id: part.toolCallId,
|
||||
output: typeof part.result === "string" ? part.result : JSON.stringify(part.result),
|
||||
output,
|
||||
...(isError ? { error: output } : {}),
|
||||
})
|
||||
break
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user