Repository navigation
Keep every open project's graph live in the Windows shell - #664
Merged
Merged
Conversation
The shell's v2 hello subscribed only to the most recently opened project, so after Ctrl+O the daemon filtered out graphChanged events for every other open project (beta17 ProjectLiveUpdates). The shell is a sidebar client, so the hello now never narrows delivery. The daemon sends v2 clients presence ticks as nodesChanged deltas, which the shell ignored, so Needs you stayed stale until an unrelated snapshot. The model now folds deltas into the held snapshot by node ID with a revision guard and applies the result as a snapshot, matching macOS foldDelta. Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com> Signed-off-by: Colin Neilens <coneilen@microsoft.com>
coneilen
force-pushed
the
coneilen-fix-windows-live-graph-updates
branch
from
October 8, 2026 22:49
4422458 to
b87d674
Compare
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.
Summary
Fixes two live-graph-update defects from the Dev Box qualification of
0.1.78-windows.beta17(4ab2fcf4). First, the qualification failureProjectLiveUpdates: after a second project was opened with Ctrl+O, the shell stopped applying live updates for the earlier project. Second, a non-gating finding: presencenodesChangeddeltas were ignored, so a loop awaiting input did not appear in Needs you until some unrelated full snapshot arrived.Changes
DaemonClient.zig): every (re)dial sent a v2 hello withsubscription.projectPathsset to the single most recently opened project. The daemon (DaemonConnectionChannel.isSubscribed) then droppedgraphChangedfor every other open project, including Core after Destructive was opened. The shell is a sidebar client (restoreOpenProjects), the same role the macOS app plays on its unfiltered v1 connection. So the hello now carries no filter.subscription_pathstill records the focused project and still triggers the existing drained re-dial, so the App open, reject and rollback flows do not change. The hello construction moved into a testablehelloFrame.GraphModel.zig,Wire.zig,App.zig): the shell never sendsannounce, but the daemon sends deltas to v2 clients anyway. Commitf6b8af41(Windows daemon port) narrowed the capability gate inGraphStore.notifyClients(nodesChanged:)to v1 connections only (V2 clients use the replay envelope for the delta), and the shell had no handler. I fixed this in the shell, not in GraphcodeKit: the daemon sends deltas to v2 on purpose, and a shell-side fix also avoids full snapshots on every presence tick.Wire.EventKind.nodes_changed, matched on the"nodesChanged":key.Model.applyNodesChangedmirrors macOSAppFeature.foldDelta. It clones the held summary, replaces nodes by ID, ignores unknown loops, unknown projects, and deltas no newer than the heldrevision(now parsed from snapshots), then applies the merged graph through the sameapplyGraphpath as a snapshot (decodeGraphwas split into decode + apply). Attention, activity, worktree-binding invalidation and the selected legacy graph are all handled by that path.App.onFrameWithEffectstreats.nodes_changedlike.graph_changed, including the accessibility republish. This is two lines plus one test inApp.zig.Tools/windows/windows-shell.ps1: the stub-daemon gate had requiredsubscriptionSeen(a filtered hello), which encoded this defect. It now fails if any hello narrows delivery.reconnectObservedstill proves the re-dial hellos were sent.subscriptionSeenstays in the stub report becauseuia-live-gate.ps1requires the key to exist.graphcode-windows/README.md: documents both behaviors and their evidence limits.Test plan
RED: zig 0.15.2 test src\DaemonClient.zig -target x86_64-windows-msvc -lc -ladvapi32 --test-filter "opening a second project keeps" -> 0 passed 1 failed, TestUnexpectedResult at the Core admission assertion (hello filtered to Destructive only)
RED: zig 0.15.2 test src\GraphModel.zig --test-filter "nodesChanged presence delta" -> 0 passed 1 failed, expected 1, found 0 Needs-you entries after the awaitingInput delta
GREEN: same two focused commands -> 1/1 passed each
REGRESSION: pwsh validate.ps1 -Task windows-shell -ShellPart unit -SkipTrayLive -ShellValidationRoot C:\gcp\v -> Windows shell scaffold contract PASS, 55 of 55 sections executed, App 891/891 passed including the new App nodesChanged test; script exit 1 only from post-run profile isolation cleanup (see notes)
Both RED failures were behavioral, not compile errors: each test used only APIs that existed before the fix (
helloFramewas added first as a no-behavior-change refactor). After rebasing on607494c0(which includes #662, #663 and #665): the full App test root passed 899/899 (including the new App test), DaemonClient 188/188 and GraphModel 160/160. The CI run on the previous head44224583passed every Windows job after one rerun. Its firstwindows-shell integrationattempt failed in "Scrubbed production shell startup" with exit0xC0000142(STATUS_DLL_INIT_FAILED):pwshfailed at process start, before printing anything, after smoke/stress and the stub-daemon gate had passed withsubscriptionSeen:false.Notes and limits:
validate.ps1exited 1 after every section passed. Its isolation cleanup reported that%USERPROFILE%\.graphcode\graphcode-windows.logchanged during the run. The same cleanup error appeared in an earlier run that stopped before any App test executed (0App.testlines), so the leak is pre-existing and outside this change. That earlier run also hit the worktree-Git fixture path budget because of the long worktree path; the short-ShellValidationRootavoided it.DaemonConnectionChannel.isSubscribed. It did not run against a livegraphcoded.Checklist
git commit -s) per the DCOmake test) — macOS target; not run (Windows-only change, Windows unit suite above)make check) — macOS Swift lint; no Swift changed