Skip to content

fix: exclude .git from push_repo_memory size calculation#22610

Merged
pelikhan merged 2 commits intomainfrom
copilot/fix-push-repo-memory-error
Mar 24, 2026
Merged

fix: exclude .git from push_repo_memory size calculation#22610
pelikhan merged 2 commits intomainfrom
copilot/fix-push-repo-memory-error

Conversation

Copy link
Contributor

Copilot AI commented Mar 24, 2026

The push_repo_memory MCP tool was reporting false-positive size limit errors ("Total memory size (30 KB) exceeds allowed limit of 12 KB") on workflows with only ~500 bytes of actual memory files. The memory directory is a git clone, and .git/objects/pack/ accumulates pack files over time — these were being counted toward the size limit.

Changes

  • safe_outputs_handlers.cjs — Skip .git directories at any depth in scanDir() so only working tree files contribute to the total size check
  • safe_outputs_handlers.test.cjs — Regression test simulating the exact scenario: small memory files + large .git/objects/pack/ entry, verifying the handler returns success
  • .changeset/patch-fix-push-repo-memory-git-size.md — Release note for the fix
function scanDir(dirPath, relativePath) {
  const entries = fs.readdirSync(dirPath, { withFileTypes: true });
  for (const entry of entries) {
    // Skip .git — pack files accumulate and must not count toward the limit
    if (entry.isDirectory() && entry.name === ".git") {
      continue;
    }
    // ...
  }
}

Warning

Firewall rules blocked me from connecting to one or more addresses (expand for details)

I tried to connect to the following addresses, but was blocked by firewall rules:

  • https://api.github.com/repos/github/gh-aw/contents/.github%2Fworkflows%2Faudit-workflows.md
    • Triggering command: /opt/hostedtoolcache/node/24.14.0/x64/bin/node /opt/hostedtoolcache/node/24.14.0/x64/bin/node --conditions node --conditions development --experimental-import-meta-resolve --require /home/REDACTED/work/gh-aw/gh-aw/actions/setup/js/node_modules/vitest/suppress-warnings.cjs /home/REDACTED/work/gh-aw/gh-aw/actions/setup/js/node_modules/vitest/dist/workers/forks.js -commit-branch bin/git git diff�� --name-status 00c116205a950fb30e4e77c7ce49acf032a7187f^ k/_temp/uv-python-dir/git -bare-UQepYn git e/git git (http block)
  • invalid.example.invalid
    • Triggering command: /usr/lib/git-core/git-remote-https /usr/lib/git-core/git-remote-https origin https://invalid.example.invalid/nonexistent-repo.git git init�� tions/node_modul-u git ndor/bin/git user.name Test User ache/node/24.14.-b /usr/lib/git-corshallow-fetch-fail main�� run --auto tions/setup/node_modules/.bin/git --detach mental-eWsFua' t git (dns block)
    • Triggering command: /usr/lib/git-core/git-remote-https /usr/lib/git-core/git-remote-https origin https://invalid.example.invalid/nonexistent-repo.git git chec�� -b main ache/go/1.25.0/x64/bin/git user.name Test User ndor/bin/git git comm�� -m Local commit 0/x64/bin/git run --auto ndor/bin/git git (dns block)

If you need me to access, download, or install something from one of these locations, you can either:


⚡ Quickly spin up Copilot coding agent tasks from anywhere on your macOS or Windows machine with Raycast.

Copilot AI changed the title [WIP] Fix push_repo_memory false-positive size limit error fix: exclude .git from push_repo_memory size calculation Mar 24, 2026
Copilot AI requested a review from pelikhan March 24, 2026 06:19
@pelikhan pelikhan marked this pull request as ready for review March 24, 2026 06:19
Copilot AI review requested due to automatic review settings March 24, 2026 06:19
@pelikhan pelikhan merged commit 1b50854 into main Mar 24, 2026
1 check passed
@pelikhan pelikhan deleted the copilot/fix-push-repo-memory-error branch March 24, 2026 06:19
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Fixes false-positive push_repo_memory size-limit failures caused by counting .git packfiles in the memory directory clone.

Changes:

  • Update recursive memory directory scanning to skip .git directories at any depth so only working-tree files contribute to size totals
  • Add a regression test covering “small memory files + large .git/objects/pack” to ensure validation succeeds
  • Add a changeset entry documenting the patch fix

Reviewed changes

Copilot reviewed 1 out of 1 changed files in this pull request and generated no comments.

File Description
actions/setup/js/safe_outputs_handlers.cjs Excludes .git directories during recursive size scanning for push_repo_memory validation.
actions/setup/js/safe_outputs_handlers.test.cjs Adds regression coverage ensuring .git packfiles do not trip size-limit validation.
.changeset/patch-fix-push-repo-memory-git-size.md Release note describing the false-positive and the fix.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[plan] Fix push_repo_memory false-positive size limit error

3 participants