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
This commit is contained in:
Lukas Wirth
2025-11-04 15:35:33 +00:00
committed by GitHub
parent 46b39f0077
commit 75cef88ea2
+4 -3
View File
@@ -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::<agent_servers::Gemini>().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::<LoadError>() {
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)