Skip to content

[backport] Bound ui_get pagination to prevent latency spikes (upstream main) #19

Closed as not planned

Description

@gastrodon

Summary

ui_get backs synchronous MCP App UI pickers (label/assignee/milestone/branch/reviewer dropdowns). Each method paginated GitHub API results in an unbounded loop (100 per page, looping until NextPage==0). On large repos/orgs this fans into dozens of sequential API calls — production telemetry showed tail latency spiking to ~20 minutes.

Fix: introduce uiGetMaxPages = 10 (1000 items maximum) constant in ui_tools.go. All pagination loops for labels, assignees, milestones, branches, and reviewers (collaborators + teams loops) now break at uiGetMaxPages. A has_more boolean is added to each response to signal truncation. uiGetIssueTypes and issue_fields are single-request and left unchanged.

Upstream reference

Fork conflict

None. The fork does not add MCP App UI tools.

Context

ui_get feeds type-ahead pickers that pair with user search input, so responsiveness matters more than completeness. Truncating at 1000 results with a has_more flag gives the UI a signal to show a "type to filter" hint rather than implying the list is exhaustive.

Activity

  1. gastrodon commented on Jun 27, 2026

    @gastrodon
    Author

    No-op. The fork already has uiGetMaxPages = 10 constant in pkg/github/ui_tools.go (line 30), with bounded pagination and has_more flag in all ui_get loops. No work needed.

  2. added
    no-opFork already has equivalent functionality
    on Jun 27, 2026
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

    backportBackport from upstreambugSomething isn't workingno-opFork already has equivalent functionality

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions