From 152a740c705f39c47edfaab17838f7499241d851 Mon Sep 17 00:00:00 2001 From: Senko Rasic Date: Tue, 4 Jun 2024 08:55:06 +0200 Subject: [PATCH] ask user if they want to debug command errors --- core/agents/error_handler.py | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/core/agents/error_handler.py b/core/agents/error_handler.py index d74b6fb3a..7a1d1b9ed 100644 --- a/core/agents/error_handler.py +++ b/core/agents/error_handler.py @@ -74,6 +74,16 @@ async def handle_command_error(self, message: str, details: dict) -> AgentRespon if not cmd: raise ValueError("No command provided in command error response details") + confirm = await self.ask_question( + "Can I debug why this command failed?", + buttons={"yes": "Yes", "no": "No"}, + default="yes", + buttons_only=True, + ) + if confirm.cancelled or confirm.button == "no": + log.info("Skipping command error debug (requested by user)") + return AgentResponse.done(self) + llm = self.get_llm() convo = AgentConvo(self).template( "debug",