diff --git a/apps/open-swe/src/utils/github/git.ts b/apps/open-swe/src/utils/github/git.ts index 9ca1e9b7..3aa2a974 100644 --- a/apps/open-swe/src/utils/github/git.ts +++ b/apps/open-swe/src/utils/github/git.ts @@ -251,6 +251,18 @@ async function performClone( logger.info("Created branch", { branch: branchName, }); + + const setUpstreamBranchRes = await sandbox.process.executeCommand( + `git branch --set-upstream-to=origin/${branchName}`, + absoluteRepoDir, + ); + if (setUpstreamBranchRes.exitCode !== 0) { + logger.error("Failed to set upstream branch", { + setUpstreamBranchRes, + }); + } + logger.info("Set upstream branch"); + return branchName; } catch { logger.info("Failed to create branch, checking out branch", { @@ -262,5 +274,17 @@ async function performClone( logger.info("Checked out branch", { branch: branchName, }); + + const setUpstreamBranchRes = await sandbox.process.executeCommand( + `git branch --set-upstream-to=origin/${branchName}`, + absoluteRepoDir, + ); + if (setUpstreamBranchRes.exitCode !== 0) { + logger.error("Failed to set upstream branch", { + setUpstreamBranchRes, + }); + } + logger.info("Set upstream branch"); + return branchName; } diff --git a/packages/shared/src/github/allowed-users.ts b/packages/shared/src/github/allowed-users.ts index fef2d861..926b39b6 100644 --- a/packages/shared/src/github/allowed-users.ts +++ b/packages/shared/src/github/allowed-users.ts @@ -54,7 +54,7 @@ export const ALLOWED_USERS = [ "xornivore", "xuro-langchain", "Palashio", - "ads2280" + "ads2280", ]; // HACK: Until we setup proper support for API credits, we will only allow users to self host Open SWE