Skip to content

Commit

Permalink
Merge pull request #992 from Pythagora-io/skip-cmd-debug
Browse files Browse the repository at this point in the history
ask user if they want to debug command errors
  • Loading branch information
LeonOstrez authored Jun 4, 2024
2 parents 7fe056b + 152a740 commit cbc03f5
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions core/agents/error_handler.py
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down

0 comments on commit cbc03f5

Please sign in to comment.