You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
fix(tui): prevent false 'task crashed' errors due to race condition
The check_crashed_tasks() function was incorrectly detecting normal task
completions as crashes. This happened because:
1. A task sends ToolEvent::Completed via the channel
2. The task terminates (is_finished() == true)
3. Before the event is processed, check_crashed_tasks() runs
4. It sees is_finished() == true and assumes it's a crash
5. It sends ANOTHER ToolEvent::Failed
The fix properly awaits the JoinHandle to check if the task actually
panicked or was cancelled. If handle.await returns Ok(()), we know the
task completed normally and its event is just pending in the channel.
This fixes the 'Subagent task terminated unexpectedly (possible panic or
cancellation)' error that appeared for tools like ListSubagents, Glob, LS.
0 commit comments