combine stdout and stderr in bash tool output (#300)

Co-authored-by: opencode <noreply@opencode.ai>
Co-authored-by: Dax Raad <d@ironbay.co>
This commit is contained in:
Tom 2025-06-23 01:24:35 +07:00 committed by GitHub
parent 37e0a7050f
commit 0e8c3359d1
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -63,10 +63,18 @@ export const BashTool = Tool.define({
metadata: {
stderr,
stdout,
exit: process.exitCode,
description: params.description,
title: params.command,
},
output: stdout.replaceAll(/\x1b\[[0-9;]*m/g, ""),
output: [
`<stdout>`,
stdout ?? "",
`</stdout>`,
`<stderr>`,
stderr ?? "",
`</stderr>`,
].join("\n"),
}
},
})