fix(coding-agent): reduce Git package installation storage - #7
Open
JohnsonRan wants to merge 2 commits into
Open
fix(coding-agent): reduce Git package installation storage#7JohnsonRan wants to merge 2 commits into
JohnsonRan wants to merge 2 commits into
Conversation
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.
Summary
Reduce the entire
.pi/agent/gitinstallation footprint, includingnode_modules, through two changes:1. Avoid installing Pi itself again inside each extension
install --omit=devstill allows automatic peer installation. Extensions declaring Pi as a peer can therefore pull Pi itself and its transitive SDK dependencies into their ownnode_modules. Embedded Bun also does this when Pi is declared as both a dev and peer dependency.Default Git dependency installs now use:
install --omit=dev --omit=peer.install --omit=dev --legacy-peer-deps.This matches the existing managed npm-package peer policy. Controlled fixtures verified that omitting peers prevents the redundant host installation while retaining ordinary runtime dependencies. Explicit
npmCommandoverrides are unchanged. Packages declaring Pi in ordinarydependenciesstill install it.2. Avoid downloading unnecessary Git history
Targets the persistent
patch/use-embedded-bun-package-managerbranch so the changes survive main's sync rebuild. No sync workflow change is needed.Measurement: Git history only, excluding
node_modules18 installed repositories were shallow-cloned into temporary directories at the same HEAD. All clones passed
git fsck; original installation file hashes were unchanged. Six repositories were already shallow.node_modulesThe shallow-clone change alone saves 18.96 MiB (38.6%) in this measurement. These figures exclude
node_modules; they do not quantify the additional benefit of avoiding redundant Pi/SDK dependencies.This is a fresh-clone-equivalent measurement, not an in-place cleanup or a claim about physical disk reclamation.
node_modulescan share hardlinks with caches and other installations, so its logical size is not the amount of disk space recoverable by deleting it.Existing extra dependencies and old Git objects are not automatically pruned. These changes reduce fresh installation size; rerunning installation does not guarantee removal of existing redundant dependencies.
Validation
npm run check: passed on the persistent-branch candidate and main integration.npm run build:offline,./test.sh, and 230 focused tests passed./proc/version. Assertions and production clipboard behavior are unchanged.One earlier full-suite run reported an empty-answer failure in the experimental remote runtime. Three candidate and three baseline isolated runs did not reproduce it; the final full suite passed. No fix is claimed for that intermittent failure.
This PR was prepared with AI assistance.