Conversation
…kdown (#23865) When repo-memory patch size exceeds the configured limit, the patch size line was logged at info level (invisible in default GitHub Actions output) and provided no breakdown of which files contributed to the large diff. Changes: - Log patch size at warning level when it exceeds the configured limit (both in the 20% overhead window and over the effective limit) - On failure, run git diff --cached --stat and emit it as a warning to show per-file line additions/deletions, clarifying WHY the patch is large (e.g. a rewritten history.jsonl shows old + new content as full diff) - Add a comment explaining that the patch size reflects the full git diff (old + new content for modified files), which can exceed the file size Root cause of run #23846022060: memory/token-metrics/history.jsonl on the branch had ~35 KB of accumulated history; the agent rewrote it to 9.8 KB, producing a 45 KB diff (deletions + additions). The computation is correct; the default max-patch-size of 10 KB was simply too small for this workflow. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Collaborator
|
@copilot deletions size should be ignored in patch size computation . It's ok to delete content and it should not be used to compute the patch size. |
Agent-Logs-Url: https://github.com/github/gh-aw/sessions/0ee9a48f-b693-487f-9b21-caecbf2e0c01 Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
Contributor
Done in 435c47b. The patch size computation now only counts added lines (starting with |
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
Investigating issue #23865: the
push_repo_memoryjob failed with a "Patch Size Exceeded" error for thedaily-copilot-token-reportworkflow.Root Cause Analysis
Patch computation: ✅ Fixed — The original implementation used the full
git diff --cachedoutput (additions + deletions) to measure patch size. This was incorrect: a workflow that rewrites a large accumulated history file (e.g. 35 KB of old content → 9.8 KB new content) would be charged ~45 KB against the limit, even though only 9.8 KB of new content is actually being pushed.Correct behavior: Only additions (new content) should count toward the patch size limit. Deletions are acceptable and do not contribute to the size of content being pushed.
The configured
max-patch-sizedefault (10 KB) was also too small for accumulating-history workflows.The Logging Bug
The logging was also insufficient to diagnose this:
core.info— invisible in GitHub Actions default output (only shown in verbose/debug mode)Changes Made
actions/setup/js/push_repo_memory.cjs+lines, excluding+++file-header lines) fromgit diff --cached. Deletions are fully ignored.git diff --cached --statoutput emitted ascore.warningon failure, showing per-file line additions/deletionsExpected Log Output After Fix
Only the 9.8 KB of new additions counts against the limit — the 35 KB of deletions is ignored.
References
push_repo_memory