From 7d4d7e58336dcd533b4cc174b4915761c256019f Mon Sep 17 00:00:00 2001 From: Johannes du Plessis Date: Tue, 5 May 2026 14:53:27 -0700 Subject: [PATCH] fix: re-apply git identity every run, drive from env vars (#1242) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * fix: re-apply git identity on every agent invocation, source from env Cached/reconnected sandboxes weren't getting `git config --global` re-applied (the call was gated on new-sandbox creation), so commits picked up whatever identity the sandbox happened to have — sometimes an email not associated with any GitHub account, which Vercel rejects on preview deploys. Move the git config call out of the new-sandbox branch so it runs on every get_agent, and source the values from OPEN_SWE_GIT_AUTHOR_NAME / OPEN_SWE_GIT_AUTHOR_EMAIL env vars (defaulting to the existing bot identity) so forks can override without code changes. * cleanup --------- Co-authored-by: open-swe[bot] --- agent/server.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/agent/server.py b/agent/server.py index c36e767e..652147c8 100644 --- a/agent/server.py +++ b/agent/server.py @@ -257,10 +257,10 @@ async def get_agent(config: RunnableConfig) -> Pregel: metadata={"sandbox_id": sandbox_backend.id}, ) - await asyncio.to_thread( - sandbox_backend.execute, - "git config --global user.name 'open-swe[bot]' && git config --global user.email 'open-swe@users.noreply.github.com'", - ) + await asyncio.to_thread( + sandbox_backend.execute, + "git config --global user.name 'open-swe[bot]' && git config --global user.email 'open-swe@users.noreply.github.com'", + ) linear_issue = config["configurable"].get("linear_issue", {}) linear_project_id = linear_issue.get("linear_project_id", "")