From e4fbd828d7b3ad9033c8477619ab3af423fe525f Mon Sep 17 00:00:00 2001 From: Brace Sproul Date: Fri, 25 Jul 2025 09:17:52 -0700 Subject: [PATCH] chore: Add git status output to log when push fails (#531) --- apps/open-swe/src/utils/github/git.ts | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/apps/open-swe/src/utils/github/git.ts b/apps/open-swe/src/utils/github/git.ts index 818b6f2d..40c98dfa 100644 --- a/apps/open-swe/src/utils/github/git.ts +++ b/apps/open-swe/src/utils/github/git.ts @@ -128,6 +128,7 @@ export async function checkoutBranchAndCommit( ); if (pushRes instanceof Error) { + const gitStatus = await sandbox.git.status(absoluteRepoDir); const errorFields = { ...(pushRes instanceof Error ? { @@ -138,7 +139,10 @@ export async function checkoutBranchAndCommit( } : pushRes), }; - logger.error("Failed to push changes", errorFields); + logger.error("Failed to push changes", { + ...errorFields, + gitStatus: JSON.stringify(gitStatus, null, 2), + }); throw new Error("Failed to push changes"); } else { logger.info("Successfully pushed changes");