Skip to content

A pull request in a GitHub merge queue reads as ready to merge, and bb offers a merge action the queue already owns #2048

Open

Description

@trieloff

Summary

On a repository that uses GitHub merge queues, bb shows no sign that a pull request has been queued. Worse than a missing indicator: a queued pull request that has already passed its pre-merge checks reports mergeable: MERGEABLE from gh, so bb classifies it as mergeability.state = "mergeable" / attention = "ready_to_merge" and renders the green "Merge" split button — for a merge the queue already owns. A queued pull request whose queue checks are still running reports mergeStateStatus: UNKNOWN and lands in mergeability.state = "unknown" ("Mergeability unknown", amber warning triangle), which is also wrong. GitHub's own UI gives queued pull requests a distinct ochre "Queued" state; bb has no equivalent.

Expected: bb shows the pull request as queued (GitHub's ochre), reports its place in the queue, and does not offer a direct merge action for it.

Versions and environment

  • bb 0.38.0, run from source at 6da2a7a9b332a02e5a25db05ac980a180fee6ab0 (main)
  • macOS 26.5.2, Node v26.0.0
  • gh version 2.97.0 (2026-07-31)
  • Repository under test: ai-ecoverse/slicc (merge queue enabled on main), observed 2026-08-20

Steps to reproduce

  1. Enable a merge queue on the base branch of a GitHub repository (ai-ecoverse/slicc here).

  2. Enqueue two pull requests: one whose queue checks are still running, one that has already passed them.

  3. Run the exact gh read the bb host daemon makes for a workspace branch — GH_PR_VIEW_JSON_FIELDS:

    gh pr view 2239 --json number,state,isDraft,mergeStateStatus,mergeable,reviewDecision
    gh pr view 2241 --json number,state,isDraft,mergeStateStatus,mergeable,reviewDecision
    
  4. Open a bb thread whose environment branch is one of those pull requests and look at the PR pill, the prompt context banner, and the thread metadata panel.

Did not reproduce with a draft pull request (bb correctly shows draft), and does not depend on the thread's provider — this is entirely in the workspace/PR read path.

Expected vs actual

Verbatim gh output for the two queued pull requests (both were in the merge queue at the time):

$ gh pr view 2239 --json number,state,isDraft,mergeStateStatus,mergeable,reviewDecision
{"isDraft":false,"mergeStateStatus":"UNKNOWN","mergeable":"UNKNOWN","number":2239,"reviewDecision":"","state":"OPEN"}

$ gh pr view 2241 --json number,state,isDraft,mergeStateStatus,mergeable,reviewDecision
{"isDraft":false,"mergeStateStatus":"UNSTABLE","mergeable":"MERGEABLE","number":2241,"reviewDecision":"","state":"OPEN"}

Both were genuinely queued, confirmed against the GraphQL API in the same window:

$ gh api graphql -f query='{repository(owner:"ai-ecoverse",name:"slicc"){mergeQueue{entries(first:20){nodes{position state pullRequest{number mergeStateStatus mergeable isInMergeQueue}}}}}}'
{"data":{"repository":{"mergeQueue":{"entries":{"nodes":[
 {"position":1,"state":"AWAITING_CHECKS","pullRequest":{"number":2239,"mergeStateStatus":"UNKNOWN","mergeable":"UNKNOWN","isInMergeQueue":true}},
 {"position":2,"state":"AWAITING_CHECKS","pullRequest":{"number":2236,"mergeStateStatus":"UNKNOWN","mergeable":"UNKNOWN","isInMergeQueue":true}},
 {"position":3,"state":"AWAITING_CHECKS","pullRequest":{"number":2231,"mergeStateStatus":"UNKNOWN","mergeable":"UNKNOWN","isInMergeQueue":true}},
 {"position":4,"state":"QUEUED","pullRequest":{"number":2241,"mergeStateStatus":"UNSTABLE","mergeable":"MERGEABLE","isInMergeQueue":true}}]}}}}}

Feeding those exact raw values through the server's own assembler (assembleThreadPullRequest) produces:

PR #2239 (UNKNOWN/UNKNOWN)    -> mergeability=unknown   attention=none
PR #2241 (UNSTABLE/MERGEABLE) -> mergeability=mergeable attention=ready_to_merge

Expected instead: both report a queued state, #2241 carries queue position 4, and neither offers a merge action.

Evidence

  • The daemon's PR read requests a fixed field list that contains no merge-queue field: git-host.ts#L32-L46. This is not an omission that can be fixed by adding a field name — gh pr view --json on 2.97.0 offers no merge-queue field at all. Full list, verbatim from gh pr view --json:

    additions assignees author autoMergeRequest baseRefName baseRefOid body changedFiles closed
    closedAt closingIssuesReferences comments commits createdAt deletions files fullDatabaseId
    headRefName headRefOid headRepository headRepositoryOwner id isCrossRepository isDraft labels
    latestReviews maintainerCanModify mergeCommit mergeStateStatus mergeable mergedAt mergedBy
    milestone number potentialMergeCommit projectCards projectItems reactionGroups reviewDecision
    reviewRequests reviews state statusCheckRollup title updatedAt url
    

    isInMergeQueue and mergeQueueEntry exist only on the GraphQL PullRequest type, so this needs a separate gh api graphql read.

  • GitHub's MergeStateStatus enum has no queued member either, so the state cannot be inferred from the fields bb already has: gitHostPullRequestMergeStateStatusSchema.

  • Server policy that misclassifies the two cases above: assembleThreadPullRequestMergeability — mergeable === "MERGEABLE" wins for #2241, and #2239 falls through to unknown.

  • The merge action is gated on exactly that state: ThreadPromptContextBanner.tsx#L1008-L1010, and the same on mobile in resolvePullRequestBannerAction.

  • The pill has no queued state; it colours by PullRequestState only (open/draft/merged/closed): PullRequestStatusPill.tsx#L21-L60.

  • The ochre token GitHub's queued state calls for already exists and needs no new colour: --attention: oklch(0.74 0.15 80) in apps/app/src/components/ui/theme.css, plus attention in the mobile native theme.

What you ruled out

  • Not a duplicate: no open or closed issue or pull request in this repository mentions merge queues; the 155 open issues were listed in full and searched.
  • Not fixable in a plugin: the data comes from the host daemon's gh invocation and flows through GitHostPullRequest → ThreadPullRequest; the pill, prompt banner, and metadata panel are core components with no slots, and adding the field is a wire change that needs a HOST_DAEMON_PROTOCOL_VERSION bump. experimental_setThreadRowStatus can decorate sidebar rows only, and would need a second redundant poll.
  • Not a stale-cache artifact: the gh pr view and GraphQL reads above were taken in the same minute and disagree about the same pull requests.
  • Not specific to one pull request: reproduced on both a queue entry still running checks (#2239) and one that had passed them (#2241), which fail in two different ways.
  • Not draft-related: draft pull requests are classified correctly today.

Suggested priority and effort

Medium-high for merge-queue repositories, which is every repository with a protected trunk at any scale — no workaround, and the failure is an action bb offers that should not be offered. Effort: Low-Medium (one extra GraphQL read on the daemon, one new mergeability/attention state, display entries on web and mobile).

AGENT GENERATED: by Claude Opus 5

Activity

  1. added theissue type on Aug 20, 2026
  2. added
    workspaces
    ui
    on Aug 20, 2026
  3. SawyerHood commented on Aug 24, 2026

    @SawyerHood
    Collaborator

    ---Auto-Generated---

    Reproduction & root-cause report: https://get-bb.github.io/reports/issues/2048.html

    • Verdict: REPRODUCED · root-cause confidence: high
    • Root cause (short): The host daemon reads PR state only via gh pr view --json with a fixed field list that has no merge-queue field (and gh offers none), so assembleThreadPullRequestMergeability classifies a queued PR as mergeable/ready_to_merge (gh: UNSTABLE/MERGEABLE) or unknown (gh: UNKNOWN/UNKNOWN), and the web/mobile/server merge gates key on exactly mergeability.state === "mergeable".
    • Proposed fix: Daemon (packages/host-workspace/src/git-host.ts): after the existing gh pr view read, make one extra read-only gh api graphql call for isInMergeQueue and mergeQueueEntry{position state enqueuedAt estimatedTimeToMerge} and return it as a new required-nullable mergeQueue field on GitHostPullRequest (packages/domain/src/thread.ts); bump HOST_DAEMON_PROTOCOL_VERSION 164 -> 165. Server (apps/server/src/services/environments/pull-request.ts): add a queued mergeability and attention state checked right after the draft branch, carry position/state/ETA on ThreadPullRequestMergeability; …
    • Caveats: Reproduced live against real merge-queue entries in the public repo ai-ecoverse/slicc (the issue author's repo) rather than a repo I control, so the exact queue states observed depended on timing; both the UNKNOWN/UNKNOWN (PR Surface collapsed child thread errors #2383, position 1) and UNSTABLE/MERGEABLE (PR Calm the iOS shell-geometry handler and the timeline resize cascade #2385, position 3) cases were captured within the same minute as the GraphQL queue truth. One claim in the issue is refuted: the…

    The report is self-contained: copy-paste repro steps with the test or script inline, expected vs actual output, screenshots where the bug is visual, and code permalinks at the base commit. It was independently re-executed by a second agent (see its Verification section).

    AGENT GENERATED: by Claude Code

  4. added
    confirmed-repro
    on Aug 24, 2026
  5. self-assigned this
    on Oct 8, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

confirmed-reprouiworkspaces

Type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions