Include changed paths in remote UpdatedEntries events - #57994
Closed
MartinYe1234 wants to merge 2 commits into
Closed
Include changed paths in remote UpdatedEntries events#57994MartinYe1234 wants to merge 2 commits into
MartinYe1234 wants to merge 2 commits into
Conversation
MartinYe1234
marked this pull request as ready for review
May 28, 2026 20:52
Contributor
Author
|
Better Approach: #58094 |
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.
Skills added to
.agents/skillsin a remote project were never picked up by the agent's skill catalog, even though the same flow works locally.Root cause
When skills are added or changed under
.agents/skills, the agent reloads its catalog in response toWorktreeUpdatedEntries, but only if a changed path under.agents/skillsis present in the event payload.For local worktrees, the payload contains the real changed paths, so the refresh fires. For remote worktrees,
Worktree::remotecollapsed all change information into a single boolean and emittedEvent::UpdatedEntries(Arc::default())— an empty changeset. The actual paths were only forwarded to the raw protoupdate_observer, never placed in the event. As a result, the agent (and every other consumer that inspects these paths, e.g. git blame invalidation, telemetry project-type detection, and the.rules/AGENTS.mdrefresh) never saw any change on remote.Fix
Reconstruct the changed-entry set from the proto updates the remote worktree already drains:
AddedOrUpdated.Removed.The event is now emitted with the populated changeset, matching local behavior.
Tests
Added
test_remote_worktree_update_entries_carry_changed_paths, which drives a remote worktree update simulating pasted skill folders and asserts the emittedUpdatedEntriescarries the added paths, plus a removal case that verifies paths are resolved from the previous snapshot.Closes AI-329
Closes #57877
Release Notes:
.agents/skillsnot appearing in the agent's skill catalog for remote projects.