Skip to content

Needs Attention: merged PR with still-pending pr gate vanishes (derivePrReady ignores merged) #966

Closed

Description

@waleedkadous

Summary

A builder whose PR is merged but whose porch pr gate is still status: pending does not appear in the dashboard's Needs Attention view — or anywhere in the Work surface. It silently vanishes.

Reproduction (real instance)

shannon builder spir-2019, project 2019-admin-dash-rename-ops-dashboar, PR #2030:

  • PR #2030 is MERGED (base ci; issue [Spec 1647] Post-merge porch state and thread #2019 auto-closed). porch recorded merged: true / merged_at: 2026-06-02T15:14:34Z in the project status.yaml.
  • Yet gates.pr.status is still pending (its requested_at was stamped ~25s after the merge — an out-of-band GitHub merge plus a resume after the recent Tower restart scrambled the ordering).
  • The live overview reports prReady: true for builder 2019.
  • It shows in neither Needs Attention nor the open-PR list.

Root cause

derivePrReady in packages/codev/src/agent-farm/servers/overview.ts:

return parsed.gates['pr'] === 'pending' && !!parsed.gateRequestedAt['pr'];

This does not consider that the PR has already merged, so a merged-but-gate-still-pending builder reads as prReady: true.

NeedsAttentionList.buildItems in packages/dashboard/src/components/NeedsAttentionList.tsx then:

  • suppresses the builder row for any prReady builder (if (b.prReady) continue;), on the assumption the PR will surface via the open-PR (pendingPRs) path; and
  • only emits a PR row for PRs present in pendingPRs (open PRs only).

A merged PR lives in recentlyClosed, not pendingPRs, so neither path emits it. A code comment in buildItems even notes this ("(merged), nothing is emitted here; the next refresh surfaces it once pendingPRs includes the open PR") — but an already-merged PR never re-enters pendingPRs, so it stays hidden permanently.

Prescribed fix

  1. Ensure the overview status-parser captures the merged boolean from status.yaml (add it if it isn't already parsed alongside gates / gateRequestedAt / prReadyForHuman).
  2. Make derivePrReady return false once the PR is merged, e.g.:
    return parsed.gates['pr'] === 'pending' && !!parsed.gateRequestedAt['pr'] && !parsed.merged;
    Rationale: once merged, the builder is no longer a "PR awaiting human review", so it must neither report prReady nor have its builder row suppressed under the (now-false) expectation of an open PR.
  3. Add unit tests in the overview tests: a parsed status with pr gate pending + requested_at + merged: true → derivePrReady returns false; keep the existing pending + requested_at (not merged) → true case green.
  4. Confirm with the repro shape that the builder no longer vanishes (no NeedsAttentionList change should be required — fixing the source flag is sufficient — but verify).

Scope / notes

Activity

  1. added
    area/tower
    on Jun 2, 2026
  2. waleedkadous commented on Jun 2, 2026

    @waleedkadous
    ContributorAuthor

    On it! Working on a fix now.

  3. waleedkadous commented on Jun 2, 2026

    @waleedkadous
    ContributorAuthor

    On it! Investigated: root cause confirmed in derivePrReady (overview.ts) — it ignores the merged flag in pr_history, so a merged-but-pr-gate-still-pending builder reads as prReady: true and gets suppressed in NeedsAttentionList. Implementing the prescribed fix (parse merged, gate it in derivePrReady) now.

  4. added 5 commits that reference this issue on Jun 2, 2026
  5. added a commit that references this issue on Jun 5, 2026
  6. added a commit that references this issue on Oct 1, 2026
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

    area/tower

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions