Skip to content

Support pagination for branch search queries #22

Closed

Description

@tofarr

Problem

The current implementation of branch search does not support pagination. When a user tries to use pagination with branch search, they receive an error:

paging is not supported when searching branches. It will be supported after API refactoring.

Expected Behavior

Branch search should support pagination similar to how regular branch listing works, allowing users to navigate through large numbers of search results.

Technical Details

The search_branches method in the Git client does not support paging in the same way as get_branches. These two methods should be merged into a single paginated method.

See code location: openhands/app_server/git/git_router.py lines 245-252

Acceptance Criteria

  • Implement pagination support for branch search queries
  • Ensure consistent behavior between branch search and branch listing

Activity

  1. added
    good first issue
    on Apr 11, 2026
  2. github-actions commented on Apr 11, 2026

    @github-actions
    Contributor

    🙌 Hey there, future contributor! 🙌

    This issue has been labeled as good first issue, which means it's a great place to get started with the OpenHands project.

    If you're interested in working on it, feel free to! No need to ask for permission.

    Be sure to check out our development setup guide to get your environment set up, and follow our contribution guidelines when you're ready to submit a fix.

    Feel free to join our developer community on Slack. You can ask for help, feedback, and even ask for a PR review.

    🙌 Happy hacking! 🙌

  3. tofarr commented on Apr 11, 2026

    @tofarr
    ContributorAuthor

    Created GitHub issue #22 to track this work. The TODO comment has been updated to reference this issue.

  4. Ella-horizon commented on Apr 30, 2026

    @Ella-horizon

    Hi @tofarr
    I am so interested in this issue.
    I would like to work on your issue.
    Thank you!

  5. yangjj-iso commented on May 16, 2026

    @yangjj-iso

    Hi, I'd like to work on this issue.
    I plan to look into openhands/app_server/git/git_router.py, compare the current branch listing and branch search implementations, and add pagination support for search while keeping the behavior consistent with regular branch listing.
    I'll keep the PR focused and include tests if there is existing coverage around the Git router/client behavior.

  6. yangjj-iso commented on May 16, 2026

    @yangjj-iso

    I've completed my investigation. I'll start working on a PR now. The approach will be:
    Add a page parameter to search_branches in the GitService protocol and each provider implementation
    For providers with native pagination support (GitLab, Bitbucket), pass the page parameter directly
    For providers with client-side filtering (GitHub GraphQL, Azure DevOps, Forgejo), handle pagination at the service level
    Remove the HTTP 400 restriction in git_router.py and pass pagination through consistently
    Add test coverage for paginated branch search
    This keeps the behavior consistent with how branch listing (get_paginated_branches) already works.

  7. Quantum0uasar commented on May 18, 2026

    @Quantum0uasar

    Hi! I'd like to work on this. Adding pagination support to branch search queries is a clearly scoped fix — it looks like the search endpoint needs to accept page/per_page parameters and pass them through correctly. I have Python backend experience and am comfortable working with API pagination patterns. Would it be okay if I take this on?

  8. shayar commented on Jun 7, 2026

    @shayar

    Hi! I'm a student in the CodePath AI301 program and I'd like to work on this issue.

    From my initial understanding, branch listing supports pagination, but branch search currently does not, which causes an error when users try to paginate through branch search results. I’ll start by reproducing the issue locally and reviewing the branch search/listing logic around openhands/app_server/git/git_router.py.

    My initial plan is to compare the behavior of search_branches and get_branches, then look for a way to make branch search use the same paginated behavior as regular branch listing. Any pointers on related tests or preferred implementation direction would be appreciated!

  9. added a commit that references this issue on Jul 13, 2026
  10. github-actions commented on Jul 18, 2026

    @github-actions
    Contributor

    This issue is stale because it has been open for 40 days with no activity. Remove the stale label or leave a comment, otherwise it will be closed in 10 days.

  11. transferred this issue fromOpenHands/OpenHandson Jul 27, 2026
  12. all-hands-bot commented on Sep 4, 2026

    @all-hands-bot
    Contributor

    [Automatic Post]: This issue has had no activity for 39 days (labels: good first issue). Could someone take a look when they have a chance and help figure out next steps?

    Generated by OpenHands automation on behalf of the user.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    good first issue

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions