[Bug] A failed shell command is displayed as a normal success
Description
execute_bash only prefixes its result with Error: for a spawn-level failure (the command couldn't be launched at all) never for a non-zero exit code. Since failure detection elsewhere string-sniffs for that Error: prefix, an ordinary failing command (a broken build, a failed test run) renders identically to a successful one in the default compact display.
Parent: #907
Steps to Reproduce
- Ask Nanocoder to run a shell command that exits non-zero (e.g.
exit 1, or a failing test command). - Look at the compact tool-activity summary (the default display mode).
Expected Behavior
Some visible indication that the command failed a different icon, color, or label.
Actual Behavior
Renders as ⚒ Ran 1 command identical to what a passing command shows.
Recording
Root Cause
source/tools/execute-bash.tsx:34-53 only prefixes Error: for a spawn-level failure. source/tools/tool-executor.tsx:161-163 classifies failure purely by content.startsWith('Error: '), so a non-zero exit code with normal stdout/stderr formatting falls through to the success path.
Suggested Fix
Make ToolResult.isError authoritative set it on non-zero exit in the bash execution path, and branch the display on that flag instead of string-sniffing the content.
Additional Context
- [x] I have searched existing issues to ensure this is not a duplicate
- [x] I can reproduce this issue consistently
- [x] This issue occurs on the latest
main
Hi @akramcodez, could you assign this to me ?