[FEATURE] CI monitor: surface branch-out-of-date (BEHIND) alongside failing checks

Resolved 💬 1 comment Opened May 20, 2026 by tuminansen Closed Jun 18, 2026

Preflight Checklist

  • [x] I have searched existing requests and this feature hasn't been requested yet
  • [x] This is a single feature request (not multiple features)

Problem Statement

The CI monitor dropdown (the small CI chip in the desktop / agents view header) tracks GitHub Actions check status but doesn't reflect GitHub's mergeStateStatus. When a PR has all green checks but the branch is "out of date with the base branch" — a common protected-branch rule — the GitHub merge button is greyed out, yet the CI monitor stays green and silent.

Today the only way to notice this is to refresh the GitHub PR page, see the warning banner, then come back and ask Claude (or run a sync command) to merge main into the branch. The CI monitor knows everything else about the PR but skips this state.

Proposed Solution

Extend the CI monitor to query mergeStateStatus (already exposed by gh pr view --json mergeStateStatus and the GraphQL API) and surface it in the same dropdown as failing checks. A new state — e.g. BEHIND — would show a distinct icon and text like "Out of date with base; merge main to enable merging." Clicking it could optionally trigger a sync action (or just open the PR's update-branch GitHub page).

The same surface covers the other "merge-blocked" states GitHub exposes — BEHIND (out of date), DIRTY (conflicting), BLOCKED (gated by review). All three are cases where merge is blocked but CI alone is green — exactly the current gap.

Alternative Solutions

Workaround today: a custom /sync-main slash command that fetches origin/main, merges, and pushes. Requires the user to notice the PR is behind and invoke it manually — defeating the purpose of having a CI monitor at all.

A passive Stop-hook that runs git fetch && git rev-list --count HEAD..origin/main after each turn is another workaround but adds network cost to every assistant turn and is configured per-repo, not per-session.

Priority

Medium - Would be very helpful

Feature Category

Interactive mode (TUI)

Use Case Example

  1. Open Claude Code on a feature branch with an active PR.
  2. CI runs green; merge button on GitHub is enabled.
  3. Someone else merges a different PR to main; the protected-branch rule now requires this PR to be up to date.
  4. GitHub greys out the merge button. Claude Code's CI monitor stays green.
  5. I waste a few minutes wondering why merge is blocked — only finding the cause by refreshing the GitHub page.

With the proposed change, the CI monitor would flip to an "Out of date" state at step 4, eliminating step 5.

Additional Context

Related but distinct: #58649 asks for branch/merge state in the Agents view for non-PR sessions. This request is about the CI monitor for PR-linked sessions — same underlying GitHub data (mergeStateStatus / ahead-behind), different surface.

GitHub's mergeStateStatus is one of CLEAN | BEHIND | DIRTY | BLOCKED | UNSTABLE | HAS_HOOKS | UNKNOWN. BEHIND is the case described above; the others are also "merge blocked despite CI green" cases that would benefit from the same surface.

View original on GitHub ↗

This issue has 1 comment on GitHub. Read the full discussion on GitHub ↗