Skip to content

Commit 73f04df

Browse files
AbirAbbasclaude
andcommitted
fix: surface actual git clone error in build logs
CalledProcessError only shows exit code, not stderr. Log the real error message (e.g. permission denied, auth failure) to make debugging clone failures straightforward. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
1 parent 21c53cf commit 73f04df

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

swe_af/app.py

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -79,12 +79,15 @@ async def build(
7979
if cfg.repo_url and not os.path.exists(os.path.join(repo_path, ".git")):
8080
app.note(f"Cloning {cfg.repo_url}{repo_path}", tags=["build", "clone"])
8181
os.makedirs(repo_path, exist_ok=True)
82-
subprocess.run(
82+
clone_result = subprocess.run(
8383
["git", "clone", cfg.repo_url, repo_path],
84-
check=True,
8584
capture_output=True,
8685
text=True,
8786
)
87+
if clone_result.returncode != 0:
88+
err = clone_result.stderr.strip()
89+
app.note(f"Clone failed (exit {clone_result.returncode}): {err}", tags=["build", "clone", "error"])
90+
raise RuntimeError(f"git clone failed (exit {clone_result.returncode}): {err}")
8891
else:
8992
# Ensure repo_path exists even when no repo_url is provided (fresh init case)
9093
# This is needed because planning agents may need to read the repo in parallel with git_init

0 commit comments

Comments
 (0)