Skip to content

fix(push_repo_memory): correct misleading "git diff format overhead" framing in pre-check error message#43301

Merged
pelikhan merged 3 commits into
mainfrom
copilot/fix-push-repo-memory-checks
Jul 4, 2026
Merged

fix(push_repo_memory): correct misleading "git diff format overhead" framing in pre-check error message#43301
pelikhan merged 3 commits into
mainfrom
copilot/fix-push-repo-memory-checks

Conversation

Copilot AI commented Jul 4, 2026

Copy link
Copy Markdown
Contributor

The push_repo_memory MCP pre-check sums raw file sizes in the memory directory, but its error message claimed the 20% buffer exists for "git diff format overhead" — wording copied from push_repo_memory.cjs where it actually applies (that gate runs git diff --cached and counts added lines). The comment also falsely asserted it "mirrors the same calculation." This made failures look like diff-size problems when the real issue was total accumulated tree size.

Changes

  • Error message: "configured limit: X KB with 20% overhead for git diff format""configured max-patch-size: X KB" — describes what was actually measured
  • Success message: removed spurious "with 20% overhead" qualifier
  • Comments: replaced "Allow 20% overhead for git diff format" and "mirrors the same calculation in push_repo_memory.cjs" with accurate descriptions of what the check does (raw file-size sum vs. the push gate's diff-addition count)

The max_patch_size × 1.2 threshold itself is unchanged — a full rewrite of all memory content must fit within the push gate's effective limit, so the factor is still valid; only the stated rationale was wrong.

The pre-check in safe_outputs_handlers.cjs measures total raw file sizes
in the memory directory, but the error message incorrectly stated
'20% overhead for git diff format' — wording that only applies to the
push gate in push_repo_memory.cjs which actually runs git diff.

- Fix the error message to say 'configured max-patch-size: X KB' instead
  of 'configured limit: X KB with 20% overhead for git diff format'
- Fix the success message to remove 'with 20% overhead'
- Fix the comment at the effective-limit calculation to explain the real
  reason (matching the push gate factor, not git diff format overhead)
- Fix the total-size check comment to remove the misleading 'mirrors the
  same calculation in push_repo_memory.cjs' framing

The 20% buffer (max_patch_size × 1.2) is kept unchanged so that a full
rewrite of all memory content stays within the push gate's effective limit.
Add changeset entry.

Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
Copilot AI changed the title [WIP] Fix push_repo_memory checks for consistency and error messaging fix(push_repo_memory): correct misleading "git diff format overhead" framing in pre-check error message Jul 4, 2026
Copilot AI requested a review from pelikhan July 4, 2026 04:49
@pelikhan pelikhan marked this pull request as ready for review July 4, 2026 04:56
Copilot AI review requested due to automatic review settings July 4, 2026 04:56
@github-actions

github-actions Bot commented Jul 4, 2026

Copy link
Copy Markdown
Contributor

Test Quality Sentinel completed test quality analysis.

No test files were added or modified in this PR. Test Quality Sentinel skipped.

@github-actions

github-actions Bot commented Jul 4, 2026

Copy link
Copy Markdown
Contributor

🧠 Matt Pocock Skills Reviewer has completed the skills-based review. ✅

@github-actions

github-actions Bot commented Jul 4, 2026

Copy link
Copy Markdown
Contributor

Design Decision Gate 🏗️ completed the design decision gate check.

No ADR enforcement needed: PR does not have the 'implementation' label and has ≤100 new lines of code in business logic directories (0 additions detected in src/, lib/, pkg/, internal/, app/, core/, domain/, services/, api/).

@github-actions

github-actions Bot commented Jul 4, 2026

Copy link
Copy Markdown
Contributor

PR Code Quality Reviewer completed the code quality review.

Copilot AI 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.

Pull request overview

This PR corrects misleading wording in the push_repo_memory safe-outputs pre-check so its messages and comments accurately describe what is being measured (raw file-size sum) and why the max_patch_size × 1.2 threshold is used (alignment with the push gate’s 1.2× factor), without incorrectly attributing it to “git diff format overhead”.

Changes:

  • Updated in-code comments in the safe-outputs handler to correctly describe the pre-check’s total-size calculation and its relationship to the push gate.
  • Revised the pre-check failure message to remove the incorrect “git diff format overhead” framing.
  • Added a changeset entry documenting the messaging/comment clarification.
Show a summary per file
File Description
actions/setup/js/safe_outputs_handlers.cjs Adjusts comments and user-facing success/error messages for the repo-memory size pre-check.
.changeset/fix-push-repo-memory-misleading-error-message.md Release note describing the corrected framing for the pre-check messaging/comments.

Review details

Tip

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

  • Files reviewed: 2/2 changed files
  • Comments generated: 2
  • Review effort level: Low

Comment thread actions/setup/js/safe_outputs_handlers.cjs
Comment thread actions/setup/js/safe_outputs_handlers.cjs

@github-actions github-actions 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.

The changes are accurate and an improvement over the previous misleading wording.

Summary:

  • Error message: "with 20% overhead for git diff format""configured max-patch-size: X KB"
  • Success message: spurious "with 20% overhead" qualifier removed ✅
  • Comments: accurately distinguish raw file-size sum (pre-check) vs. diff additions (push gate) ✅

The actual threshold logic (maxPatchSize × 1.2) is unchanged — only the explanation is corrected. The changeset entry is appropriately scoped as a patch. No blocking issues.

🧵 Reviewed using Impeccable skills by Impeccable Skills Reviewer · 17.9 AIC · ⌖ 5.91 AIC · ⊞ 4.9K

@github-actions github-actions 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.

Skills-Based Review 🧠

Applied /diagnosing-bugs — good targeted fix; two minor follow-up suggestions.

📋 Key Themes & Highlights

Key Themes

  • Error message UX gap: After removing the (wrong) "20% overhead" note, the message now shows two diverging KB values without explaining the 1.2× multiplier that connects them. This could leave users puzzled about the discrepancy.
  • Residual comment ambiguity: The inline comment at line 1535–1536 says the factor is "matching the push gate" — which may still imply the two checks are equivalent, when only the factor is shared, not the measurement mechanism.

Positive Highlights

  • ✅ Root cause correctly identified: the wrong rationale in comments and messages was the bug, not the threshold itself.
  • ✅ Changeset entry is accurate and thorough — clearly communicates what changed and why.
  • ✅ The 1.2× threshold is intentionally preserved with a proper explanation in the PR body.
  • ✅ Small, surgical diff — easy to review and reason about.

🧠 Reviewed using Matt Pocock's skills by Matt Pocock Skills Reviewer · 41.4 AIC · ⌖ 5.22 AIC · ⊞ 6.6K
Comment /matt to run again

Comment thread actions/setup/js/safe_outputs_handlers.cjs
Comment thread actions/setup/js/safe_outputs_handlers.cjs

@github-actions github-actions 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.

Review: comment accuracy on the guarantee in new comments

The existing review comments (lines 1537 and 1651) have already surfaced the two most important issues. I found one additional concern on the new comment at line 1634 not yet covered.

📋 Findings summary

Not blocking, but worth noting: The new comment at line 1634 says "a full rewrite of all memory content would remain within the push gate limit". This is not strictly guaranteed. The push gate counts Buffer.byteLength(line + "\n") for every +-prefixed diff line — each added line carries one extra byte (the + prefix) on top of the file content. Raw file-size sums omit this per-line overhead. For large files with many lines, the pre-check could pass while the push gate still fails. The comment should soften this to "is designed to keep total content within the push gate limit" or "provides a conservative proxy for the push gate limit".

Otherwise the diff is comment/message-only with no logic changes. The max_patch_size × 1.2 threshold is unchanged and the intent of the fix is correct.

🔎 Code quality review by PR Code Quality Reviewer · 153.5 AIC · ⌖ 6.95 AIC · ⊞ 5.4K
Comment /review to run again

Comment thread actions/setup/js/safe_outputs_handlers.cjs
Comment thread actions/setup/js/safe_outputs_handlers.cjs
@github-actions

github-actions Bot commented Jul 4, 2026

Copy link
Copy Markdown
Contributor

🛠️ Agentic Maintenance updated this pull request branch.

View workflow run

@pelikhan pelikhan merged commit d6e5d80 into main Jul 4, 2026
14 checks passed
@pelikhan pelikhan deleted the copilot/fix-push-repo-memory-checks branch July 4, 2026 06:58
@github-actions

github-actions Bot commented Jul 7, 2026

Copy link
Copy Markdown
Contributor

🎉 This pull request is included in a new release.

Release: v0.82.3

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.

push_repo_memory: pre-check measures total content, push gate measures diff additions — same config knob, mismatched semantics + misleading error

3 participants