From d6e601ea2e2a221327ba854ec4d7a7aa951edd05 Mon Sep 17 00:00:00 2001 From: answer-huang Date: Tue, 11 Mar 2025 03:47:33 +0800 Subject: [PATCH] =?UTF-8?q?bugfix:=20selected=5Frepository=20may=20include?= =?UTF-8?q?s=20more=20then=20two=20parts,=20could=20b=E2=80=A6=20(#7114)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- openhands/runtime/base.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/openhands/runtime/base.py b/openhands/runtime/base.py index 6a2ce91a8f..291c8f3063 100644 --- a/openhands/runtime/base.py +++ b/openhands/runtime/base.py @@ -274,7 +274,7 @@ class Runtime(FileEditRuntimeMixin): 'github_token and selected_repository must be provided to clone a repository' ) url = f'https://{github_token.get_secret_value()}@github.com/{selected_repository}.git' - dir_name = selected_repository.split('/')[1] + dir_name = selected_repository.split('/')[-1] # Generate a random branch name to avoid conflicts random_str = ''.join( @@ -313,7 +313,7 @@ class Runtime(FileEditRuntimeMixin): microagents_dir = workspace_root / '.openhands' / 'microagents' repo_root = None if selected_repository: - repo_root = workspace_root / selected_repository.split('/')[1] + repo_root = workspace_root / selected_repository.split('/')[-1] microagents_dir = repo_root / '.openhands' / 'microagents' self.log( 'info',