fix(execute-command): return partial output on timeout/maxBuffer instead of throwing

When a command times out or exceeds the buffer limit, the route returns
partial stdout/stderr. Previously the handler threw an Error, discarding
that output. Now returns partial output with an error field so downstream
blocks can inspect it.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
Waleed Latif
2026-03-05 13:05:10 -08:00
parent cf67966e15
commit 24e1bfdf09

View File

@@ -44,6 +44,12 @@ export class ExecuteCommandBlockHandler implements BlockHandler {
)
if (!result.success) {
if (result.output) {
return {
...result.output,
error: result.error || 'Command execution failed',
}
}
throw new Error(result.error || 'Command execution failed')
}