From 7dbb1a2aa8da137fa00d3e0a7ca30bececd99a50 Mon Sep 17 00:00:00 2001 From: "Paul Gauthier (aider)" Date: Mon, 31 Mar 2025 09:21:34 +1300 Subject: [PATCH] fix: Return test errors from cmd_run to enable auto-fixing --- aider/commands.py | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/aider/commands.py b/aider/commands.py index d28bee4ea..81fc80093 100644 --- a/aider/commands.py +++ b/aider/commands.py @@ -1014,9 +1014,15 @@ class Commands: dict(role="assistant", content="Ok."), ] - if add and exit_status != 0: + if add_on_nonzero_exit and exit_status != 0: + # Return the formatted output message for test failures + return msg + elif add and exit_status != 0: self.io.placeholder = "What's wrong? Fix" + # Return None if output wasn't added or command succeeded + return None + def cmd_exit(self, args): "Exit the application" self.coder.event("exit", reason="/exit")