agent: Fix tool use output rendering (#28146)

Agus Zubiaga created

Tool use output wouldn't get rendered in some states.

Release Notes:

- N/A

Change summary

crates/agent/src/active_thread.rs | 6 +++++-
1 file changed, 5 insertions(+), 1 deletion(-)

Detailed changes

crates/agent/src/active_thread.rs 🔗

@@ -706,7 +706,11 @@ impl ActiveThread {
                         tool_use.id.clone(),
                         tool_use.ui_text.clone(),
                         &tool_use.input,
-                        "".into(),
+                        self.thread
+                            .read(cx)
+                            .tool_result(&tool_use.id)
+                            .map(|result| result.content.clone().into())
+                            .unwrap_or("".into()),
                         window,
                         cx,
                     );