Skip to content

Include changed paths in remote UpdatedEntries events - #57994

Closed
MartinYe1234 wants to merge 2 commits into
mainfrom
martin/ai-329-skills-not-visible-in-catalog-for-remote-projects
Closed

Include changed paths in remote UpdatedEntries events#57994
MartinYe1234 wants to merge 2 commits into
mainfrom
martin/ai-329-skills-not-visible-in-catalog-for-remote-projects

Conversation

@MartinYe1234

Copy link
Copy Markdown
Contributor

Skills added to .agents/skills in 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 to WorktreeUpdatedEntries, but only if a changed path under .agents/skills is present in the event payload.

For local worktrees, the payload contains the real changed paths, so the refresh fires. For remote worktrees, Worktree::remote collapsed all change information into a single boolean and emitted Event::UpdatedEntries(Arc::default()) — an empty changeset. The actual paths were only forwarded to the raw proto update_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.md refresh) never saw any change on remote.

Fix

Reconstruct the changed-entry set from the proto updates the remote worktree already drains:

  • Updated entries carry their path on the wire, reported as AddedOrUpdated.
  • Removed entries only carry ids, so their paths are resolved against the previous snapshot (captured before it is replaced) and reported as 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 emitted UpdatedEntries carries the added paths, plus a removal case that verifies paths are resolved from the previous snapshot.

Closes AI-329

Closes #57877

Release Notes:

  • Fixed skills in .agents/skills not appearing in the agent's skill catalog for remote projects.

@MartinYe1234 MartinYe1234 self-assigned this May 28, 2026
@cla-bot cla-bot Bot added the cla-signed The user has signed the Contributor License Agreement label May 28, 2026
@zed-community-bot zed-community-bot Bot added the staff Pull requests authored by a current member of Zed staff label May 28, 2026
@MartinYe1234
MartinYe1234 marked this pull request as ready for review May 28, 2026 20:52
@MartinYe1234
MartinYe1234 requested a review from cole-miller May 29, 2026 17:24
@MartinYe1234

Copy link
Copy Markdown
Contributor Author

Better Approach: #58094

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

cla-signed The user has signed the Contributor License Agreement staff Pull requests authored by a current member of Zed staff

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Skills are not see in catalog if in .agents/skills for remote project

1 participant