Skip to content

fix: cut GitHub API spend on coverage, etags, feedback, CI, and releases - #179

Merged
jeremymcs merged 5 commits into
mainfrom
jeremymcs/github-quota-coverage
Aug 20, 2026
Merged

fix: cut GitHub API spend on coverage, etags, feedback, CI, and releases#179
jeremymcs merged 5 commits into
mainfrom
jeremymcs/github-quota-coverage

Conversation

@jeremymcs

Copy link
Copy Markdown
Owner

Summary

Stops PatchDeck from burning GitHub quota on repeated reads of data it already has.

  • Issue coverage no longer hits GET /search/issues on every UI poll. The Issues page reads persisted githubOpenCount from the issue sweep (GraphQL totalCount, ~1 point).
  • Open PR lists persist etag + summaries so a process restart is a 304, not a full pagination.
  • Issue sweeps reuse the conditional page-1 body instead of fetching page 1 twice.
  • PR comment/review lists are probed with If-None-Match; an all-304 skips the nested review-thread GraphQL query. Nested comment pages drop from 100 to 20.
  • Settled commit SHA CI (statuses + check runs) is loaded once per Octokit client.
  • listMergedPullsSince stops paging closed PRs once updated_at is older than the since bound.

Commits

  1. fix: stop Search API polling for issue coverage
  2. fix: persist PR list etags and reuse issue page 1
  3. fix: skip review-thread GraphQL when PR comments are unchanged
  4. fix: reuse settled CI status fetches for a commit SHA
  5. fix: stop paging closed PRs once the release since-bound is passed

Plan: docs/plans/github-rate-limit-cache.md

Test plan

  • npm test (715 passing)
  • npx tsx --test client/src/lib/*.test.ts (90 passing)
  • npm run check
  • With the dashboard running, open Issues and confirm synced N / GitHub M still renders after a sweep. /api/issues/coverage should not call Search.

Issue coverage now reads persisted GitHub open counts from the
issue sweep instead of hitting GET /search/issues on every UI poll.
Open PR lists survive restart via github_etags.payload so a 304 no
longer re-paginates. Issue sweeps use the conditional page-1 body
instead of fetching it twice.
Probe comment/review lists with If-None-Match and skip the nested
GraphQL lookup on a 304. Shrink thread comment pages from 100 to 20.
Commit status and check-run results for a settled SHA are loaded once
per Octokit client and shared across poll, snapshot, and failure helpers.
listMergedPullsSince now walks closed PRs page by page and stops when
updated_at is older than the since bound or the merge-sha boundary hits.
@github-actions

Copy link
Copy Markdown
Contributor

📄 Documentation Review Reminder

This PR changes source files but does not update any public documentation.

Changed source files:

client/src/lib/fullAppQaSurface.test.ts
client/src/pages/issues.tsx
server/appRuntime.test.ts
server/appRuntime.ts
server/babysitter.test.ts
server/babysitter.ts
server/github.test.ts
server/github.ts
server/memoryStorage.ts
server/sqliteStorage.ts
server/storage.test.ts
server/storage.ts

Please check if documentation in docs/public/ needs to be updated:

  • No documentation update needed
  • Documentation updated in this PR
  • Follow-up documentation issue created

Public docs are Markdown files in docs/public/. They are automatically
rendered to HTML and deployed to GitHub Pages when merged to main.

Available docs: getting-started.md, pr-babysitter.md, agent-dispatch.md, configuration.md, pr-questions.md

@jeremymcs
jeremymcs merged commit 9a2c34d into main Aug 20, 2026
8 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