Skip to content

[Bug] Large diffs cause commit/push/PR action to fail. #413

@jcampuza

Description

@jcampuza

Probably an edge case, but large changes currently cause the git commit/push action to fail. Of course its encouraged to make smaller changes, but I went ahead and had codex do a full migration from pnpm to bun and a monorepo for one of my apps and it causes this action to fail.

Screenshot attached:
Image

This appears to occur because the git diff/patch is needed to generate a summary of the changes for the PR description/body that is created with this action. Maybe a graceful fallback could be introduced that if the limit is exceeded return a truncated flag, and fallback the description that is generated to something indicating a large diff was detected.

In apps/server/src/git/Layers/GitService.ts

if (bytes > maxOutputBytes) {
        return yield* new GitCommandError({
          operation: input.operation,
          command: quoteGitCommand(input.args),
          cwd: input.cwd,
          detail: `${quoteGitCommand(input.args)} output exceeded ${maxOutputBytes} bytes and was truncated.`,
        });
      }

Sidenote: The error text appears to indicate it was "truncated" but in reality its just an error, since in reality the operation was simply aborted.

How to reproduce

Generate a very large diff on a repo and then try to use the git commit and push/pr action button.

Suggestion

Suggestions could any of the following:

  • Gracefully fallback if the limit was exceeded to a fallback PR body/description - generate a generic PR description that just says the diff was very large and to review manually or that automated summary was not able to be generated.
  • Alternatively just use what was able to be gathered to generate the summayr but append that the automated summary used limited context.

Other mild suggestions

  • Common reasons this might occur would be lockfile changes or large generated files, maybe if common lockfiles are detected they are pruned from the summary collection?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions