Skip to content

Reduce GitHub background polling and batch repository queries - #3447

Merged
ymichael merged 1 commit into
mainfrom
bb/fix-issue-3406-github-polling-thr_sz6uesqjge
Sep 10, 2026
Merged

ymichael merged 1 commit into
mainfrom
bb/fix-issue-3406-github-polling-thr_sz6uesqjge

Conversation

@ymichael

Copy link
Copy Markdown
Collaborator

Human comments

What was wrong

The GitHub plugin launched four list processes for every tracked repository and repeated successful sweeps after a five-minute wait, even when the catalog was unchanged. A deterministic 34-repository reproduction launched 136 list processes per sweep. This proves polling amplification; it does not establish quota exhaustion or interactive failures.

What changed

Batch each repository's four bounded issue/PR lists into one gh api graphql call, and wait 15 minutes after successful sweeps. Preserve creation order, result limits, closed/merged PRs, gh author serialization, disabled-issues handling, cached rows on failed responses, immediate manual refresh, and the existing five-minute retry cap. Validate GraphQL responses before replacing repository rows.

The interval remains internal policy with no new configuration or CLI/SDK member. README and marketplace overview document the behavior. HOST_DAEMON_PROTOCOL_VERSION is unchanged because no server/daemon wire contract changes.

For 34 repositories, fetch process launches drop from 136 to 34 per sweep. Combined with the longer wait, the negligible-duration steady-state projection drops from 1,632 to 136 fetch processes/hour, excluding startup, manual refresh, retries and authentication. HTTP request counts are source-derived, not live-measured; GraphQL point savings are unmeasured.

How you verified

  • Deterministic fake-process/fake-clock regressions failed against the original cadence and separate-list implementation before the changes.
  • Real SQLite tests cover mapping, disabled issues, empty results, malformed/partial responses, cache retention and cross-repository failure isolation.
  • Timing tests preserve manual RPC/CLI refresh, retry/reset behavior and parked shutdown. Existing in-flight sweeps still finish on abort.
  • Offline query validation against GitHub's public GraphQL schema; no live polling requests used in regression tests.
  • 46 tests passed across 8 files; Turbo test/typecheck/build completed successfully (7 tasks). Targeted lint, formatting and diff checks passed.

Fixes #3406

AGENT GENERATED

@ymichael
ymichael merged commit 171ebaf into main Sep 10, 2026
16 checks passed
@ymichael
ymichael deleted the bb/fix-issue-3406-github-polling-thr_sz6uesqjge branch September 10, 2026 23:24
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.

GitHub plugin syncs every 5 minutes with 4 gh list calls per tracked repo

1 participant