Skip to content

create_pull_request fails with large commits #18501

Closed

Description

@strawgate

I, like most great Git users, commit large images to my repositories and have come across the following issue:

[debug] Executing git command: git merge-base --is-ancestor 63cbd710fdbba6f5fba7445209203bd1a6581cec HEAD
[debug] Git command completed successfully with no output
[debug] Executing git command: git rev-list --count 63cbd710fdbba6f5fba7445209203bd1a6581cec..HEAD
[debug] Git command output: 1

[debug] Executing git command: git format-patch 63cbd710fdbba6f5fba7445209203bd1a6581cec..HEAD --stdout
[error] Git command failed with error: spawnSync git ENOBUFS
[2026-02-26T10:47:47.790Z] [safeoutputs] Patch generation failed: No changes to commit - no commits found
[2026-02-26T10:47:47.790Z] [safeoutputs] Handler returned for tool: create_pull_request
[2026-02-26T10:49:05.059Z] [safeoutputs] Calling handler for tool: create_pull_request
[2026-02-26T10:49:05.063Z] [safeoutputs] Using current branch for create_pull_request: aw/head-sampling-article-20260226
[2026-02-26T10:49:05.063Z] [safeoutputs] Generating patch for create_pull_request with branch: aw/head-sampling-article-20260226
[debug] Executing git command: git show-ref --verify --quiet refs/heads/aw/head-sampling-article-20260226

afaik, ENOBUFS normally occurs because the process that started it has only allocated a small buffer (1mb) and git has filled it up

Activity

  1. locked and limited conversation to collaborators on Feb 26, 2026
  2. unlocked this conversation on Feb 26, 2026
  3. changed the title [-]create_pull_request fails with very commits[/-] [+]create_pull_request fails with very large commits[/+] on Feb 26, 2026
  4. changed the title [-]create_pull_request fails with very large commits[/-] [+]create_pull_request fails with large commits[/+] on Feb 26, 2026
  5. strawgate commented on Feb 26, 2026

    @strawgate
    ContributorAuthor

    Root cause: execGitSync() in actions/setup/js/git_helpers.cjs calls spawnSync() without setting maxBuffer, so Node.js defaults to ~1MB. When git format-patch --stdout produces a patch larger than that (e.g. large binary files), the buffer is exceeded and the command fails.

    Every other handler in the codebase (mcp_handler_shell.cjs, mcp_handler_python.cjs, mcp_handler_javascript.cjs, mcp_handler_go.cjs) sets maxBuffer: 10 * 1024 * 1024 (10MB).

    Fix: Add maxBuffer to the spawnSync call in git_helpers.cjs:30:

    const result = spawnSync("git", args, {
      encoding: "utf8",
      maxBuffer: 10 * 1024 * 1024,
      ...options,
    });
  6. locked and limited conversation to collaborators on Feb 26, 2026
  7. pelikhan commented on Feb 26, 2026

    @pelikhan
    Collaborator

    @copilot refactor sizes in comon .cjs file, include creating helpers to compute those.

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

Metadata

Metadata

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions