Skip to content

Prune directory symlinks from repo watches#13252

Open
VitalyAnkh wants to merge 1 commit into
warpdotdev:masterfrom
VitalyAnkh:fix/nix-store-ignored-symlink-watch-growth
Open

Prune directory symlinks from repo watches#13252
VitalyAnkh wants to merge 1 commit into
warpdotdev:masterfrom
VitalyAnkh:fix/nix-store-ignored-symlink-watch-growth

Conversation

@VitalyAnkh

Copy link
Copy Markdown
Contributor

Description

Fixes a repository watcher/indexing failure mode where force-included project skill directories could cause Warp to recursively watch directory symlinks into large external trees, such as Nix store closures.

The repo tree builder already treats directory symlinks as non-materialized entries. This change makes should_watch_repo_directory mirror that behavior before applying force-included path matching. Force-included provider directories such as .agents/skills and .codex/skills are still watched, and the existing non-recursive symlink-target watcher path remains responsible for standing-query symlink targets.

Linked Issue

Fixes #13233

  • The linked issue is labeled ready-to-spec or ready-to-implement.
  • Where appropriate, screenshots or a short video of the implementation are included below (especially for user-visible or UI changes).

No UI screenshots are included because this is a repository watcher/resource-use fix. The issue contains the pre-fix memory screenshot.

Testing

  • Added a Unix regression test for a force-included provider directory containing an ignored result directory symlink.
  • cargo test -p repo_metadata should_watch_prunes_force_included_directory_symlink --features local_fs
  • cargo test -p repo_metadata should_watch --features local_fs
  • cargo test -p repo_metadata standing_queries_report_symlinked_skills_without_materializing_symlinked_directories --features local_fs
  • cargo test -p repo_metadata --features local_fs (113 passed, 2 ignored)
  • bash ./script/format --check
  • bash ./script/check_no_inline_test_modules
  • nix develop --command bash -lc 'PATH=/tmp/warp-corepack-bin:$PATH cargo clippy --workspace --exclude warp_completer --all-targets --tests -- -D warnings'
  • nix develop --command bash -lc 'PATH=/tmp/warp-corepack-bin:$PATH cargo clippy -p warp_completer --all-targets --tests -- -D warnings'
  • nix build .#warp-terminal-experimental --print-out-paths --print-build-logs
  • Manually tested the Nix-built app locally with a real Warp profile and real/synthetic symlink-heavy repositories. I used the built binary rather than ./script/run so the test matched the Linux/NixOS failure mode.

Manual runtime checks with the fixed binary:

  • /home/vitalyr/nix-vault: indexed /home/vitalyr/nix-vault with 585 files; 95s sample kept inotify watches flat at 5293 -> 5293, /nix/store fds 0 -> 0, RSS 653572 -> 765752 KiB.
  • /home/vitalyr/nix-vault/.codex/skills: indexed /home/vitalyr/nix-vault with 585 files; 90s sample kept inotify watches flat at 5293 -> 5293, /nix/store fds 0 -> 0, RSS 716380 -> 985564 KiB.
  • Synthetic Git repo with 81 directory symlinks, including 40 under .agents/skills and 40 under .codex/skills pointing into /nix/store: indexed with 3 files; 91s sample kept inotify watches flat at 5311 -> 5311, /nix/store fds 0 -> 0.
  • Same synthetic repo launched from .agents/skills: 93s sample kept inotify watches flat at 5311 -> 5311, /nix/store fds 0 -> 0.

For comparison, the pre-fix repro on /home/vitalyr/nix-vault grew from about 21.6k to 56.9k inotify watches and multiple GiB of RSS while opening fds under /nix/store.

  • I have manually tested my changes locally with ./script/run

Screenshots / Videos

Not applicable; this is a non-UI resource-use fix.

Agent Mode

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

CHANGELOG-BUG-FIX: Fixed a Linux repository watcher issue where directory symlinks inside project skill directories could cause excessive memory and inotify watch growth.

@cla-bot cla-bot Bot added the cla-signed label Jun 30, 2026
@oz-for-oss

oz-for-oss Bot commented Jun 30, 2026

Copy link
Copy Markdown
Contributor

@VitalyAnkh

Every PR must be linked to a same-repo issue before Oz can review it.

This PR is linked to #13233, but no linked issue is marked ready-to-implement yet. Only repository maintainers apply that label, so please wait for a maintainer to mark the issue. Once it is marked, push a new commit or comment /oz-review to re-trigger review.

See the contribution guidelines for the full readiness model.

Powered by Oz

@github-actions github-actions Bot added the external-contributor Indicates that a PR has been opened by someone outside the Warp team. label Jun 30, 2026

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

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

@VitalyAnkh

Every PR must be linked to a same-repo issue before Oz can review it.

This PR is linked to #13233, but no linked issue is marked ready-to-implement yet. Only repository maintainers apply that label, so please wait for a maintainer to mark the issue. Once it is marked, push a new commit or comment /oz-review to re-trigger review.

See the contribution guidelines for the full readiness model.

Powered by Oz

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

Labels

cla-signed external-contributor Indicates that a PR has been opened by someone outside the Warp team.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Linux/NixOS: Warp grows to ~20 GiB RSS while repository watchers/indexing touch /nix/store paths

1 participant