diff --git a/automation/patcher.py b/automation/patcher.py index b5e5b39..b3acdb0 100644 --- a/automation/patcher.py +++ b/automation/patcher.py @@ -224,6 +224,12 @@ def call_model(model: ModelConfig, prompt: str, cwd: Path) -> str: cwd=str(cwd), shell=True, ) + # Check if we got output even if returncode is non-zero + # (claude CLI returns 1 even on successful prompt responses) + if result.stdout.strip(): + return result.stdout + + # Only raise error if we got nothing useful if result.returncode != 0: raise PatchGenerationError(f"AI command failed ({result.returncode}): {result.stderr.strip()}") return result.stdout