From e40681ca61fb2b4b602fe916d99def6b55b78d77 Mon Sep 17 00:00:00 2001 From: Xingyao Wang Date: Thu, 14 Aug 2025 16:44:12 -0400 Subject: [PATCH] fix: increase max branches limit to 5000 to fix #10332 (#10333) --- openhands/integrations/github/github_service.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/openhands/integrations/github/github_service.py b/openhands/integrations/github/github_service.py index de9bde9826..91bc59fb18 100644 --- a/openhands/integrations/github/github_service.py +++ b/openhands/integrations/github/github_service.py @@ -496,15 +496,15 @@ class GitHubService(BaseGitService, GitService, InstallationsService): """Get branches for a repository""" url = f'{self.BASE_URL}/repos/{repository}/branches' - # Set maximum branches to fetch (10 pages with 100 per page) - MAX_BRANCHES = 1000 + # Set maximum branches to fetch (100 per page) + MAX_BRANCHES = 5_000 PER_PAGE = 100 all_branches: list[Branch] = [] page = 1 # Fetch up to 10 pages of branches - while page <= 10 and len(all_branches) < MAX_BRANCHES: + while len(all_branches) < MAX_BRANCHES: params = {'per_page': str(PER_PAGE), 'page': str(page)} response, headers = await self._make_request(url, params)