#17647: fix: Display error messages instead of (no output) for non-Claude models
stale
size: XS
Cluster:
TUI and Tool Execution Fixes
## Summary
When non-Claude models (Groq, MiniMax, Kimi) return errors, the error was being silently suppressed and users saw "(no output)" instead of the actual error message. This fix ensures that errors are always displayed to users.
## Changes
- Modified `src/tui/tui-event-handlers.ts` to:
1. Never suppress messages that have `stopReason="error"`
2. If `finalText` is "(no output)" but there is an error, directly extract and display the error message using `extractTextFromMessage()`
## Testing
- Existing tests in `src/tui/tui-event-handlers.test.ts` pass
- Existing tests in `src/tui/tui-formatters.test.ts` pass
Fixes openclaw/openclaw#17598
<!-- greptile_comment -->
<h3>Greptile Summary</h3>
Adds a defensive fallback to ensure error messages from non-Claude models (Groq, MiniMax, Kimi) are always displayed to users instead of showing "(no output)". When `streamAssembler.finalize()` returns "(no output)" but the message has `stopReason="error"`, the code now directly extracts the error message using `extractTextFromMessage()` as a fallback. The suppression logic was also updated to never suppress messages with errors.
<h3>Confidence Score: 5/5</h3>
- This PR is safe to merge with minimal risk
- The change is a focused defensive fix that adds a fallback mechanism for error display. The logic is sound: it only triggers when finalText is "(no output)" AND there's an error, then extracts the error message. The suppression logic correctly checks for errors to prevent hiding them. Existing tests pass, and the change doesn't modify any core logic paths.
- No files require special attention
<sub>Last reviewed commit: 92b0dfe</sub>
<!-- greptile_other_comments_section -->
<!-- /greptile_comment -->
Most Similar PRs
#6819: fix(tui): handle unstructured tool results and errors in tool execu...
by TreyDong · 2026-02-02
78.2%
#20516: fix(tui): preserve streamed text on finalize for pure text responses
by MisterGuy420 · 2026-02-19
78.1%
#6502: fix(tui): skip empty text for tool-only assistant turns
by douvy · 2026-02-01
77.1%
#9173: Fix: Improve error messaging for API rate limits and billing errors
by vishaltandale00 · 2026-02-04
77.0%
#12191: fix: guard against undefined model.input in display and scan layers
by mcaxtr · 2026-02-09
76.9%
#23279: fix: show correct context limit in status when runtime model differs
by Imccccc · 2026-02-22
76.9%
#21932: fix(tui): eliminate stale model indicator lag in TUI
by graysurf · 2026-02-20
76.8%
#15914: feat: add messages.suppressMediaPlaceholders config option
by Shuai-DaiDai · 2026-02-14
76.6%
#12974: fix: intermittent (no output) reported by users
by vincentkoc · 2026-02-10
76.3%
#6059: fix #6044
by vivganes · 2026-02-01
76.2%