Event-based git refresh with a self-healing backstop and a disable setting - #783
Merged
sbertix merged 2 commits intoAug 8, 2026
Merged
Conversation
Event-driven refresh alone drops edges that polling used to heal, so a dropped signal became permanent for the session. Add a rare, foreground-only reconcile sweep that rolls through worktrees one at a time: it re-arms each watcher (recovering a dead kqueue / file-event stream), re-emits remote line counts and pull-request refreshes, and so heals linked-worktree commits, external GitHub merges, and remote status with no local event. Watch the linked-worktree admin dir so commit-driven changes heal at event speed, coalesce overlapping diffs per worktree, and repair watchers on a manual refresh. Add an `automaticRepositoryRefreshEnabled` setting that stops background status polling (remote-branch SSH poll, reconcile sweep, and automatic pull-request checks) to avoid SSH passphrase prompts and GitHub rate limiting; worktree discovery stays live and user-initiated refreshes always run. The value is seeded at watcher construction so a disabled user never eats a launch-time burst.
SupaReviewOn it, AI code review will be updated here once ready. |
sbertix
deleted the
sbertix/gh-622-event-based-git-polling-and-ability-to-d
branch
August 8, 2026 00:58
|
Thank you! |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #622
Closes #542
Closes #615
Summary
Makes worktree status refresh event-driven with a rare, self-healing
backstop, and adds a setting to turn background refresh off.
the worktree (plus the linked-worktree admin dir) and a kqueue on
HEAD—so the recurring idle
git diff HEAD --shortstatCPU spikes are gone.time and heals the edges pure event-triggering drops: linked-worktree
commits, remote line counts, external GitHub merges (auto-archive-on-merge),
and a dead watcher. It re-arms watchers, so a manual refresh repairs a
broken one.
(
automaticRepositoryRefreshEnabled, on by default) stops the remote-branchSSH poll, the reconcile sweep, and automatic pull-request checks. Turn it
off to stop SSH passphrase prompts ([Feature Request] Stop git polling #542) or GitHub rate limiting (Too-frequent GitHub status polling eats rate limits #615)
from background polling. Worktree discovery stays live and user-initiated
refreshes always run.
Builds on and salvages @lmjiang's event-driven groundwork from #664 (that
commit is preserved here); this re-adds the backstops that review found
missing there.
Known limitations (documented, both self-healing)
its pull-request status on the next refresh, not the current one.
setting off (the frequent per-worktree remote poll is gated); it reuses the
SSH ControlMaster, so it rarely re-prompts.
Type of change
ready)How was this tested?
New tests cover the reconcile backstop (remote refresh, local stays event-driven,
stagger, dead-watcher catch-up), the disable gate (automatic suppressed / manual
bypasses / queued-manual replay / post-mutation refresh), the linked-worktree
admin-dir root, settings persistence + missing-key default, and the scene-phase
and settings-change watcher wiring.
make checkpasses (format + lint)make testpassesChecklist
Closes #above.ready.