Skip to content

Cloud Agent repository picker lists repositories multiple times when an org has several GitHub installations #5887

Description

@maphew

Summary

When starting a new Cloud Agent thread in an organization that has more than one connected GitHub installation, the repository picker lists the same repository multiple times — once per installation that can see it.

Steps to reproduce

  1. As an organization with multiple GitHub accounts/orgs connected to the same Kilo organization (each its own GitHub App installation), open Cloud Agent → new thread.
  2. Open the repository picker.
  3. Observe a repository that is reachable from more than one installation (for example acme/api is owned by one connected account and accessible as a collaborator repo on another, or the App was reinstalled leaving two active installation rows for the same account).

Expected behavior

Each repository appears exactly once in the picker, resolved to the installation that will be used for the session.

Actual behavior

The same repository appears once per GitHub installation that lists it, so the list shows duplicate entries.

Cause

fetchAllGitHubRepositoriesForOrganization (apps/web/src/lib/cloud-agent/github-integration-helpers.ts) unions the repository lists of every healthy GitHub integration for the organization:

repositories: results.flatMap(result => result.repositories),

No deduplication is performed across installations, so a repo visible through two installations is returned twice. NewSessionPanel then renders every entry (keyed by platformIntegrationId, not by repo name), producing the duplicate rows.

Notes

Activity

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

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions