Skip to content

Avoid project skill refresh scans for unrelated repo updates#12040

Merged
moirahuang merged 3 commits into
masterfrom
moira/beachball
Jun 2, 2026
Merged

Avoid project skill refresh scans for unrelated repo updates#12040
moirahuang merged 3 commits into
masterfrom
moira/beachball

Conversation

@moirahuang
Copy link
Copy Markdown
Contributor

@moirahuang moirahuang commented Jun 2, 2026

Description

In the PR https://github.com/warpdotdev/warp/pull/11559/changes, we introduced triggering refresh_project_skills_for_repo() on every FileTreeEntryUpdated. This PR attempts to address that by having FileTreeEntryUpdated only trigger refresh_project_skills_for_repo() if there is a skills relevant update by passing through the exact updates.

Tested by locally creating a repository with approximately 90,000 files and on dev, unrelated file edits entered the expensive project-skill refresh path on the main thread. With this change, identical unrelated edits no longer invoke project-skill refresh traversal, while edits to .agents/skills/repro/SKILL.md still refresh correctly.

I'm purposefully not entirely moving the full tree traversal off the main thread. This already existed before the PR, the regression is specifically that we're triggering the scan too often on unnecessary file changes. It'd still be good to address the full tree traversal on the main thread separately, specifically for the large repo case.

Testing

Manual regression validation:

  • On dev: making an unrelated edit captured refresh_project_skills_for_repo at approximately 1146 ms and find_symlinked_skill_files_in_tree at approximately 695 ms on the main thread.

  • Positive control: editing /tmp/warp-skill-refresh-repro-7reije9h/.agents/skills/repro/SKILL.md in the patched build still triggered SkillWatcher::refresh_project_skills_for_repo (approximately 1600 ms) through find_project_skill_files_in_tree.

  • Regression check: sampling the patched build for 45 seconds during 30 edits to /tmp/warp-skill-refresh-repro-7reije9h/packages/pkg-000/src/unrelated.txt captured zero matches for SkillWatcher, refresh_project_skills_for_repo, find_project_skill_files_in_tree, find_skill_files_in_tree, find_symlinked_skill_files_in_tree, get_repo_contents, or collect_contents_recursive.

  • I have manually tested my changes locally with a WarpLocal build launched via wrun.

Agent Mode

  • Warp Agent Mode - This PR was created via Warp's AI Agent Mode

CHANGELOG-BUG-FIX: Fixed project skill refreshes causing UI stalls when unrelated files change in large repositories.

moirahuang and others added 2 commits June 1, 2026 18:00
Co-Authored-By: Oz <oz-agent@warp.dev>
@cla-bot cla-bot Bot added the cla-signed label Jun 2, 2026
@oz-for-oss
Copy link
Copy Markdown
Contributor

oz-for-oss Bot commented Jun 2, 2026

@moirahuang

I'm starting a first review of this pull request.

You can view the conversation on Warp.

I completed the review and no human review was requested for this pull request.

Comment /oz-review on this pull request to retrigger a review (up to 3 times on the same pull request).

Powered by Oz

Copy link
Copy Markdown
Contributor

@oz-for-oss oz-for-oss Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Overview

This PR carries precise repository metadata deltas through file-tree update events and uses them to avoid refreshing project skills for unrelated incremental changes, while keeping conservative refreshes for opaque updates. The added tests cover unrelated local and remote deltas, skill-file additions, provider-directory updates, and known skill removals.

Concerns

  • No blocking correctness, security, or spec-drift concerns found in the annotated diff.

Verdict

Found: 0 critical, 0 important, 0 suggestions

Approve

Comment /oz-review on this pull request to retrigger a review (up to 3 times on the same pull request).

Powered by Oz

Copy link
Copy Markdown
Member

@kevinyang372 kevinyang372 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Approving to unblock

Comment thread crates/repo_metadata/src/local_model.rs Outdated
return true;
}

let is_local_repo = matches!(repo_id, RepositoryIdentifier::Local(_));
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hmmm why are we filtering by local repo here?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

we currently only support symlinking in the local path. it'll be possible after #12047, i can make a follow-up PR to refactor here once that PR is merged

{
return true;
}

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do we have to always query the entire update subtree? Is there any pre-filtering we could apply here that allows us to early return?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

i can't really think of a good pre-filter solution here because skills can be anywhere in the subtree?

@moirahuang moirahuang enabled auto-merge (squash) June 2, 2026 04:23
@moirahuang moirahuang merged commit ac4225c into master Jun 2, 2026
26 checks passed
@moirahuang moirahuang deleted the moira/beachball branch June 2, 2026 04:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants