Skip to content

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

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

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

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions