From 75cef88ea2dbf7c8b76f7902a67c93eb43ff09ed Mon Sep 17 00:00:00 2001 From: Lukas Wirth Date: Tue, 4 Nov 2025 16:35:33 +0100 Subject: [PATCH] agent_ui: Render error context when failing to spawn agent thread (#41908) Release Notes: - Fixed not telling the user what went wrong when spawning ACP agents --- crates/agent_ui/src/acp/thread_view.rs | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/crates/agent_ui/src/acp/thread_view.rs b/crates/agent_ui/src/acp/thread_view.rs index b19e0434be054b63676e2c5623c6f305b7a7c472..ed2984abd382b5c38516e8fecc0b9a976996b27f 100644 --- a/crates/agent_ui/src/acp/thread_view.rs +++ b/crates/agent_ui/src/acp/thread_view.rs @@ -104,7 +104,7 @@ impl ThreadError { { Self::AuthenticationRequired(acp_error.message.clone().into()) } else { - let string = error.to_string(); + let string = format!("{:#}", error); // TODO: we should have Gemini return better errors here. if agent.clone().downcast::().is_some() && string.contains("Could not load the default credentials") @@ -113,7 +113,7 @@ impl ThreadError { { Self::AuthenticationRequired(string.into()) } else { - Self::Other(error.to_string().into()) + Self::Other(string.into()) } } } @@ -795,7 +795,8 @@ impl AcpThreadView { if let Some(load_err) = err.downcast_ref::() { self.thread_state = ThreadState::LoadError(load_err.clone()); } else { - self.thread_state = ThreadState::LoadError(LoadError::Other(err.to_string().into())) + self.thread_state = + ThreadState::LoadError(LoadError::Other(format!("{:#}", err).into())) } if self.message_editor.focus_handle(cx).is_focused(window) { self.focus_handle.focus(window)