Skip to content

fix(poll): stop merged committed-bot PRs from sticking as open - #46

Merged
mthines merged 4 commits into
mainfrom
fix/stale-committed-bot-prs
Oct 3, 2026
Merged

mthines merged 4 commits into
mainfrom
fix/stale-committed-bot-prs

Conversation

@mthines

@mthines mthines commented Oct 3, 2026 •

Copy link
Copy Markdown
Owner

Why

Bot-opened PRs you committed to (e.g. dash0-dev[bot]) stayed in the deck as open drafts long after they merged. The committed-PR search returns every PR the bot opened for anyone (130 right now), and with the full field selection a 100-node page hit GitHub's time budget (502/504) on most polls. The half-size retry made the poller treat the query as incomplete, so it carried the bot's previous PRs forward. Merged ones can never come back through an is:open search, so nothing ever removed them.

What changed

  • searchCommittedPRs fetches in two steps: a light search (only id + commit authors, about 2.3s per 100 nodes, paged up to 5 pages), then nodes(ids:) with the full fields for just your PRs. Results left unread at the page cap are reported as incomplete.
  • Every carried-forward PR is now checked with one cheap state lookup (fetchPRStates), and droppingFinished drops the ones GitHub reports MERGED/CLOSED. A PR with an unknown state is kept, so it can't re-notify as new.
  • New counter mainline.poll.carried_forward_dropped; CLAUDE.md and docs/telemetry.md updated.

How to verify

  • The new assertions in PollCarryForwardChecks pass, and fail when droppingFinished is turned into a no-op. Debug build is green.
  • Against live data: the state lookup on the 20 bot PRs in my local store returned 10 MERGED, 1 CLOSED and 9 OPEN, so the 11 finished ones are dropped on the next poll. The paged search returned 100 + 30 nodes.

The committed-PR bot query searched every PR a bot opened (for anyone)
with the full field selection; at 100 nodes it timed out on most polls,
so it only ever got the half-size retry through. That degraded page
made the poller carry the bot's previous PRs forward indefinitely,
including ones that had since merged, which an is:open search can never
return to clear them.

- searchCommittedPRs: light candidate search (id + commitAuthors), then
  nodes(ids:) with the full selection for only the viewer's PRs.
- droppingFinished: vet carried-forward PRs with one cheap state lookup
  and drop the ones GitHub reports MERGED/CLOSED (unknown is kept).
- mainline.poll.carried_forward_dropped counter.
@mthines

mthines commented Oct 3, 2026 •

Copy link
Copy Markdown
Owner Author

✅ No issues found

Docs-only delta: CLAUDE.md now describes the paged committed-PR fetch and the page-cap degraded report, matching GitHubClient. Prior threads are resolved; nothing new found.

Checked: 3 of 5 changed files read · no possible issues found

Progress: open review threads 1 → 1 → 0 across the last 3 reviews

Review details
Gate Status Details
Description vs. code ✅ Description now covers the paged candidate search and the page-cap degraded report.
Prior review feedback ✅ Earlier review comments are resolved.
Documentation ✅ CLAUDE.md and docs/telemetry.md describe the two-step fetch, paging, and the new counter.
Self-review signals ✅ No debug logs, leftover TODOs, or unreviewed stubs.
Code review ✅ The multi-lens review found no blocking issues.

Found

Quality — produced 0 → posted inline 0 · cleared 0 · carried forward 0 · deferred 0 · below-bar 0
Standards — ran — CLAUDE.md:251 and :505 now match GitHubClient.committedSearchMaxPages (5) and the degraded cap path

Run

full · 4 lines in delta · tier deep · depth checkout
Integrations — not activated (no manifest or lockfile in the diff)
Memories — no relevance rules or lessons consulted

Nothing to report — optimality (skipped), measurability (skipped), severity, 0 files skipped.

pr-reviewer · commit c7c52f3 · full review · how these findings are produced · updated Oct 3, 2026 1:39pm UTC

Comment thread Mainline/Mainline/Services/GitHubClient.swift Outdated
A busy org bot has more than one 100-node page of open PRs (130 for
dash0-dev), and the viewer's PRs can sit past rank 100. Page through up
to committedSearchMaxPages pages and report the result degraded when
results are left unread, so the poller carries those PRs forward instead
of dropping them and re-notifying them as new.

Addresses review by @mthines: #46 (comment)
Hoist the five copies of the GraphQL FORBIDDEN check into one
[GraphQLError].containsForbidden helper.
Comment thread CLAUDE.md Outdated
@mthines
mthines marked this pull request as ready for review October 3, 2026 13:40
@dash0-dev

dash0-dev Bot commented Oct 3, 2026

Copy link
Copy Markdown
Contributor

Darkplane auto-approval is enabled for this repository (mode: Auto-approve).

Trigger an evaluation for this pull request when it is ready:

Run auto-approval evaluation

@mthines
mthines merged commit 332b301 into main Oct 3, 2026
4 checks passed
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.

1 participant