mirror of
https://github.com/NousResearch/hermes-agent.git
synced 2026-07-27 17:58:07 +00:00
fix(desktop): count output_preview as command output
The nonzero-exit guard already knew a failing exit code with real output usually isn't a failure worth painting red. It only looked at output / stdout / stderr, but background-process polls report their text under output_preview — so a poll of any process that exited nonzero rendered destructive-red with no error to show, even when the output was routine npm chatter. Half the red process rows in a real session history were this case.
This commit is contained in:
parent
717746ecf8
commit
87ee6a52fa
1 changed files with 3 additions and 1 deletions
|
|
@ -676,10 +676,12 @@ function toolErrorText(part: ToolPart, result: Record<string, unknown>): string
|
|||
// stage's code, etc. — all routinely produce useful output and aren't
|
||||
// failures. Only treat it as an error when the command produced no real
|
||||
// output to show; otherwise render the output normally (not red).
|
||||
// `output_preview` counts as output: background-process polls report their
|
||||
// text under that name, so omitting it painted healthy `process` rows red.
|
||||
const exit = numberValue(result.exit_code)
|
||||
|
||||
if (exit !== null && exit !== 0) {
|
||||
const hasOutput = Boolean(firstStringField(result, ['output', 'stdout', 'stderr'])?.trim())
|
||||
const hasOutput = Boolean(firstStringField(result, ['output', 'stdout', 'stderr', 'output_preview'])?.trim())
|
||||
|
||||
return hasOutput ? '' : `Command failed with exit code ${exit}.`
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue