Skip to content

fix(agent-manager): avoid unrelated merged PR badges - #13872

Merged
marius-kilocode merged 1 commit into
mainfrom
fix-describe-environments-to-honour-config
Sep 7, 2026
Merged

marius-kilocode merged 1 commit into
mainfrom
fix-describe-environments-to-honour-config

Conversation

@marius-kilocode

Copy link
Copy Markdown
Collaborator

What Problem This Solves

A new worktree can start at a commit that was previously the head of a merged or closed pull request. The commit-SHA fallback searched all pull request states and displayed that unrelated pull request on the new worktree.

Why This Change Was Made

The SHA fallback now searches only open pull requests. Branch-based lookups are unchanged, so a worktree on an actual merged or closed PR branch still displays its matching status.

User Impact

Fresh worktrees no longer inherit unrelated merged or closed PR badges when they share an initial commit with an older pull request. Open fork-style pull requests found through an exact head SHA continue to display normally.

Evidence

Before, a fresh branch incorrectly showed the unrelated merged PR badge:

Before fix, fresh worktree shows unrelated merged PR badge

After, the same fresh branch has no PR badge:

After fix, fresh worktree has no unrelated PR badge

The actual Agent Manager flow was tested with a disposable local Git fixture and deterministic GitHub CLI responses. The baseline reproduced the merged badge, while the fixed build removed it. The fixed build also preserved the merged badge for the actual branch and the open badge for an exact-SHA open PR.

Validation:

  • bun run compile
  • bun run typecheck
  • bun test tests/unit/am-pr-status-bridge.test.ts
  • bun run check-kilocode-change
  • git diff --check

@kilo-code-bot

kilo-code-bot Bot commented Sep 7, 2026

Copy link
Copy Markdown
Contributor

Code Review Summary

Status: No Issues Found | Recommendation: Merge

Files Reviewed (3 files)
  • .changeset/quiet-pr-sha-match.md
  • packages/kilo-vscode/src/agent-manager/PRStatusPoller.ts
  • packages/kilo-vscode/tests/unit/am-pr-status-bridge.test.ts

Reviewed by grok-4.6 · Input: 112.2K · Output: 11.6K · Cached: 252.7K

Review guidance: REVIEW.md from base branch main

@marius-kilocode
marius-kilocode merged commit 44d723c into main Sep 7, 2026
25 checks passed
@marius-kilocode
marius-kilocode deleted the fix-describe-environments-to-honour-config branch September 7, 2026 12:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants