Rebase ejects a large PR when GitHub times out creating its tree (422 on POST git/trees)

Open
#370 1 comment 0 reactions 0 assignees View on GitHub

Maintainers usually reply within 1 day

Nobody has claimed this yet.

Assessment

Difficulty
4/5
Estimated time
3-5 days
Newbie friendliness
52/100
Issue type
Bug
Clarity
Mostly clear
Activity status
Active
Tech stack
github, rust

Research direction

Start by tracing the rebase step that creates trees through GitHub's REST Git Data API and find where a 422 response becomes a final ejection. The issue identifies large trees and GitHub timeouts as the failure case, but does not name files or tests. Done means large rebases can complete or handle this timeout without immediately ejecting the PR.

Written by the indexing model from the issue text.

Description

Observed

MergeLoop ejected https://github.com/agent-labs-dev/nebula/pull/14165 at its rebase step (status comment https://github.com/agent-labs-dev/nebula/pull/14165#issuecomment-7293249931, 2026-11-30T22:01:59Z):

Ejected: the rebase failed: POST /repos/agent-labs-dev/nebula/git/trees: 422 Unprocessable Entity {"message":"Sorry, your request timed out.  It's likely that your input was too large to process.  Consider building the tree incrementally, or building the commits you need in a local clone of the repository and then pushing them to GitHub.","status":"422"}

The PR is a large refactor (about 80 files, a few thousand changed lines, with merge commits from main) in a large repository. Nothing about the PR itself was wrong: the rebase never produced a tree.

Verified vs suspected

  • Verified: the ejection came from GitHub's git/trees create call timing out, not from a conflict or a failed check.
  • Suspected cause: the rebase builds each commit's tree through the REST Git Data API in one request; for a large tree GitHub times out. GitHub's own message suggests building the tree incrementally (base_tree plus only the changed entries) or rebasing in a local clone.
  • Suspected gap: a 422 timeout is transient/size-bound, but it was treated as a final ejection with no retry or fallback.

Reproduction

Queue a PR whose rebase touches a large tree in a large repository (as above) and watch the rebase step.

Duplicates checked: searched this repo for "git/trees", "timed out" and "tree 422 rebase"; only closed, unrelated #114 and #58.

Dominant language
Rust
Stars
6
Forks
0
Avg merge
4h 17m
Merged PRs (30d)
132

Getting set up

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from agent-labs-dev/mergeloop

All issues in agent-labs-dev/mergeloop

Similar issues

More Rust issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.