Repository navigation
fix(server): scope Git status polling to the current worktree - #7
Draft
Harold Hunt (huntharo) wants to merge 2 commits into
Draft
Harold Hunt (huntharo) wants to merge 2 commits into
Harold Hunt (huntharo) wants to merge 2 commits into
Conversation
Thread transfer impact✅ Thread transfer remains within every enforced ceiling.
Other scenariosAll 64 scenario measurements match All 64 scenario measurements
Baseline: Scenario and decoded snapshot size10 historical turns, 5 command tools per turn, 878.9 KiB retained MCP result per historical turn, and a 1.05 MiB retained result in the measured turn.
Updated in place by a trusted workflow. PR artifacts are strictly validated and never executed. |
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.
Problem
Each idle remote status poll ran
git show-ref --headfor every subscribed checkout. A shared checkpoint ref or a commit in a sibling worktree then invalidated local status and Changes totals in every linked checkout.Change
Polls read the checkout's HEAD, effective config, comparison base and shallow boundaries through scoped Git queries. The same Git ref read supplies upstream divergence and the remote default branch. The service falls back to the full read for inputs it cannot resolve reliably. Full local reads resolve remote presence and the default branch in the checkout's own Git config. Explicit refreshes compute the branch-picker digest separately from their status inputs.
Scope
This follows up on the idle refresh optimization in pingdotgg#40093. The polling change overlaps pingdotgg#38949 in
refreshRemoteStatus. Related PRs cover config discovery in pingdotgg#30838 and fetch refspecs in pingdotgg#34042. Short base overrides, nonstandard upstream mappings and replacement refs use the full read.Verification
vp run check:changed origin/mainpassed with 605 tests passing and one skipped. One 30-second poll tick per row on macOS arm64 with Git 2.56.0-dev-pwrgit.3 and Node 26.12.1. The fixture uses real Git linked worktrees and a local bare remote. The poll clock is simulated and elapsed time is measured on the host. The ref counts below are extra remote-tracking refs, in addition to the worktrees' branch and upstream refs.The sibling row includes zero full local reads in the 49 unaffected worktrees. The seeded tests use 20261125 and 424242 and compare poll results to direct Git across linked worktrees, loose, packed and reftable refs, upstream and base moves, worktree-specific config and checkout changes. Separate cases verify shallow deepening, unborn status, and fallback.
Commands
Run the handoff's
bench-status-inputs.tswith itsharness.tsandresolve-hook.mjsimports pointing at the checkout. Use the same command atfbd939eb4candbead997e08.AI usage: Codex GPT-6.2-Sol xhigh with Codex harness via PwrAgent desktop.
Open in [code]smith · Need help on this PR? Tag
@codesmith-botwith what you need.