In this article
Aider uses the test command outcome as feedback; a wrapper that hides failure can make a broken change look finished to the edit loop.
Make the command express the check
Aider cannot infer a failed assertion from a command that reports success. Before adding automatic tests, choose a command that exercises the changed behavior and exits unsuccessfully when that behavior is wrong. Keep the invocation reproducible in the project’s actual environment. A missing dependency or incorrect working directory is different evidence from a regression in the edited function.
Read the test invocation contract
The linting and testing guide says /test runs the supplied command without appending arguments. Required test selectors or configuration therefore belong in that command or its wrapper. The command should print diagnostic information to standard output or error and return a nonzero status on failure. A wrapper that catches every exception and exits successfully can prevent the assistant from receiving the feedback needed to investigate.
Distinguish tests from general command output
The command reference describes /test as adding output to chat on a nonzero exit; /run can optionally add a command’s output. These interfaces support different conversations. Use a failing test to provide repair evidence, and retain the check’s actual meaning rather than treating every printed warning as a failing assertion. A successful command does not establish coverage of a branch that the chosen tests never executed.
Enable repetition deliberately
The options reference separates --test-cmd from --auto-test, which is disabled by default. Configuring a command alone should not be described as proof that it runs after every edit. There is also a separate test-and-exit option. Record the selected workflow and inspect the effective settings when a session behaves differently from an example. Choose a bounded, relevant check before scheduling it into the edit loop.
Verify the feedback and the repaired behavior
Use an authorized sample change with an observable failing case, inspect the diagnostic Aider receives, and compare the final behavior against the original requirement. The task-contract guide helps define that requirement, while tool observations separate command execution from successful repair. Review the diff as well as the final test result: making a test pass by weakening its assertion does not satisfy the intended behavior.
Earn rental income from GPUs
Have idle GPUs or looking to fund AI infrastructure? Retrivium finds a rental platform, sets up the server and helps you assess income and costs with a pilot.