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:
minpeter
2026-02-27 01:44:51 +09:00
parent 3cff4c1bce
commit a2b2cb7e87
3 changed files with 28 additions and 10 deletions
+5 -2
View File
@@ -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
}