Skip to content

fix(tui): display error message when subagent crashes#295

Merged
echobt merged 1 commit intomasterfrom
fix/display-subagent-error-on-crash
Jan 27, 2026
Merged

fix(tui): display error message when subagent crashes#295
echobt merged 1 commit intomasterfrom
fix/display-subagent-error-on-crash

Conversation

@echobt
Copy link
Contributor

@echobt echobt commented Jan 27, 2026

Summary

Previously when a subagent task crashed or failed, it was immediately removed from the UI without displaying what error occurred. This made debugging very difficult as users could see the task disappear but had no information about what went wrong.

Changes

  • Add error_message field to SubagentTaskDisplay to store the error
  • Update ToolEvent::Failed handler to set the error message and keep the failed subagent visible instead of immediately removing it
  • Update render_subagent to display the error message in red when status is Failed
  • Failed subagents are still cleaned up on the next conversation turn via clear_tool_calls which retains only non-terminal subagents

Testing

  • When a subagent crashes, users will now see:
    ● Task code
      ⎿ Error: 
        <error message displayed in red>
    
  • The error message is truncated at 5 lines and 70 characters per line to fit the display
  • Failed subagents remain visible until the next conversation turn starts

Previously when a subagent task crashed or failed, it was immediately
removed from the UI without displaying what error occurred. This made
debugging very difficult as users could see the task disappear but had
no information about what went wrong.

Changes:
- Add error_message field to SubagentTaskDisplay to store the error
- Update ToolEvent::Failed handler to set the error message and keep
  the failed subagent visible instead of immediately removing it
- Update render_subagent to display the error message in red when
  status is Failed
- Failed subagents are still cleaned up on the next conversation turn
  via clear_tool_calls which retains only non-terminal subagents
@echobt echobt merged commit 6af58d8 into master Jan 27, 2026
2 of 3 checks passed
@echobt echobt deleted the fix/display-subagent-error-on-crash branch January 27, 2026 15:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants