Skip to content

node_runtime: Bound managed npm cache growth - #61428

Closed
AlisinaDevelo wants to merge 1 commit into
zed-industries:mainfrom
AlisinaDevelo:fix/managed-npm-cache-growth
Closed

node_runtime: Bound managed npm cache growth#61428
AlisinaDevelo wants to merge 1 commit into
zed-industries:mainfrom
AlisinaDevelo:fix/managed-npm-cache-growth

Conversation

@AlisinaDevelo

Copy link
Copy Markdown

Objective

Solution

  • Install registry npm agents into their existing stable per-agent prefixes, replacing the previous version in place.
  • Resolve and execute the installed package binary using npm's binary-selection rules.
  • Use a temporary download cache when an agent package changes, while reusing unchanged installations without invoking npm.
  • Remove legacy _npx and _cacache directories once, preserving unrelated cache contents such as npm logs.

Testing

  • cargo test -p node_runtime (23 tests passed)
  • cargo check -p project
  • cargo clippy -p node_runtime --all-targets -- -D warnings
  • cargo clippy -p project -- -D warnings
  • On macOS, upgraded an agent-style bounded npm package from 7.7.1 to 7.7.2 in the stable prefix and confirmed that npm created zero _npx environments.

Linux and Windows were not manually tested.

Self-Review Checklist:

  • I've reviewed my own diff for quality, security, and reliability
  • Unsafe blocks (if any) have justifying comments
  • The content adheres to Zed's UI standards (no UI changes)
  • Tests cover the new/changed behavior
  • Performance impact has been considered and is acceptable

Release Notes:

  • Fixed unbounded npm cache growth caused by registry agent package updates.

Install registry npm agents into stable per-agent prefixes so version updates replace the prior dependency tree. Use temporary download caches for those installs and reclaim legacy npm caches once.

Refs zed-industries#59409
@cla-bot cla-bot Bot added the cla-signed The user has signed the Contributor License Agreement label Jul 22, 2026
@zed-community-bot zed-community-bot Bot added the first contribution the author's first pull request to Zed. NOTE: the label application is automated via github actions label Jul 22, 2026
@AlisinaDevelo

Copy link
Copy Markdown
Author

Hey, just checking in on the npm cache change—does this need anything else from me to move forward?

@huzaif-fahad

Copy link
Copy Markdown

Hey @AlisinaDevelo #61750 I think this PR fixed this issue, I am not sure as I am not a rust dev. Just for your info ^

@SomeoneToIgnore

Copy link
Copy Markdown
Contributor

Sorry: apparently, the PR was overlooked as never left the draft status and, as mentioned, another one was created to fix the issue.

Will close this one as the fix is merged now.

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 first contribution the author's first pull request to Zed. NOTE: the label application is automated via github actions

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Managed npm cache (node/cache) grows unbounded, never pruned

3 participants