Replace process spawn with IPC for hydration status in hooks#1919
Merged
tyrielv merged 1 commit intomicrosoft:masterfrom Mar 24, 2026
Merged
Replace process spawn with IPC for hydration status in hooks#1919tyrielv merged 1 commit intomicrosoft:masterfrom
tyrielv merged 1 commit intomicrosoft:masterfrom
Conversation
ff7a1d1 to
a3f5750
Compare
KeithIsSleeping
left a comment
There was a problem hiding this comment.
Multi-Model Code Review
Reviewed with Claude Opus 4.6, GPT-5.1-Codex-Max, and GPT-5.4. Findings below are consensus items where multiple models independently identified the same issue.
Replace gvfs.exe process spawn with named pipe IPC for hydration status display in git status pre-command hook. - Rename LockNamedPipeMessages to SharedNamedPipeMessages, add HydrationStatus message types with structured response (split Placeholder/Modified counts) - Hook queries mount process via named pipe with 100ms Task.Run bound - InProcessMount handles hydration status IPC requests - GitStatusCache caches EnlistmentHydrationSummary, exposed via IPC - HealthVerb tries IPC cache first, falls back to in-proc computation - Split HydratedFileCount/FolderCount into Placeholder + Modified components - Record circuit breaker failure on unexpected exceptions - Add HydrationStatusErrorPathTests (IPC parsing, cancellation, edge cases) Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
a3f5750 to
a1ba896
Compare
KeithIsSleeping
approved these changes
Mar 24, 2026
KeithIsSleeping
left a comment
There was a problem hiding this comment.
All feedback addressed: HealthVerb now has Task.Wait timeout (500ms connect + 1s total), cachedHydrationSummary cleared on invalidation/error/shutdown. LGTM.
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.
Replace process spawn with IPC for hydration status in hooks
The pre-command hook previously spawned
gvfs.exe health --statuson everygit status, adding ~200ms+ of process creation overhead. This replaces that with a named pipe query to the mount process, which returns the cached hydration summary in <10ms.The mount process already computes the hydration summary in
GitStatusCacheon each rebuild cycle. This PR caches that result and serves it over IPC, so the hook just reads the cached value instead of recomputing it.Changes
HydrationStatus.Request,ResponsewithTryParse/ToBody/ToDisplayMessage; integer overflow fix in percentage calcProcessHelper.Run("gvfs health --status")withTryDisplayCachedHydrationStatus()— named pipe query with 50ms connect + 100ms outer timeout; remove circuit breaker check (mount handles it)HydrationStatus.Request— returns cached summary orNotAvailableResultwith telemetryEnlistmentHydrationSummaryin volatile field; expose viaGetCachedHydrationSummary();RecordFailure()on unexpected exceptionsGetCachedHydrationSummary()toGitStatusCacheTryGetCachedHydrationMessage), fall back to in-proc computationHydratedFileCount/FolderCountintoPlaceholder+Modifiedcomponents for granular IPC response; fix integer overflowHydrationStatusNamedPipeMessages.csfile-link; removeHydrationStatusCircuitBreaker.csfile-link