`git checkout` hardcoded 30s timeout fails on large (Unity) repos; LFS handling unclear
git checkout hardcoded 30s timeout fails on large (Unity) repos; LFS handling unclear
Summary
The checkout step inside the review reasoner appears to have a hardcoded ~30 second
timeout on the git checkout subprocess call. This fails outright on large repositories
— in our case a Unity project where a large working tree (tens of GB, much of it binary
game assets) is inherent to the tech stack, not a misconfiguration. There's no documented
env var to raise this timeout.
Environment
- Deployment: GitHub Actions,
docker compose up -dper the Quick Start CI pattern - Auth: working GH_TOKEN/PAT (confirmed — clone itself succeeds)
AGENTFIELD_SERVER/AGENT_CALLBACK_URLexplicitly set for cross-container Compose networking- Target repo: large Unity project, Git LFS in use for binary assets (textures, models, audio)
What happened
Clone succeeds. The subsequent checkout fails: ❌ Execution exec_20260907_152418_9t8iyq6g failed asynchronously: Command ['git', '-C', '/workspaces/Kaiju-pr378', 'checkout', '-B', 'pr-review', 'FETCH_HEAD'] timed out after 30 seconds
Control-plane logs show the agent stalling for several minutes around this point before the failure surfaces:
"Agent pr-af marked inactive after 4 consecutive failures" (T+68s) "✅ Agent pr-af recovered to active" (T+216s)
Two things we'd like clarified/fixed
-
Make the checkout timeout configurable. A 30s ceiling on materializing a working tree is workable for small repos but not for anything with a substantial checkout size — large monorepos, Unity/Unreal projects, etc. An env var (e.g.
PR_AF_GIT_TIMEOUT_SECONDS) or a multiplier tied toPR_AF_MAX_DURATION_SECONDSwould let us tune this per-repo instead of hitting a wall we can't move. -
Please clarify actual LFS behavior. The runtime Dockerfile installs
gitbut notgit-lfsas a distinct package, which we assumed meant LFS smudge content is skipped (pointer files only) during checkout. But git-lfs ships bundled in some environments/ distros, so we're not fully confident that assumption holds inside this image — and if LFS smudging is running, that would independently explain a slow/timed-out checkout on a repo with significant LFS-tracked binary assets. Could you confirm definitively whetherGIT_LFS_SKIP_SMUDGE(or equivalent) is set, and document it either way? Right now this is inferred from reading the Dockerfile rather than stated anywhere.
Happy to provide full docker compose logs output or test against a smaller reproduction
repo if that's useful.
Fix is up in #78.
The git ceilings are configurable now — PR_AF_GIT_CHECKOUT_TIMEOUT_SECONDS, plus clone / fetch / diff variants and PR_AF_GIT_TIMEOUT_SECONDS as an umbrella for all of them — and the checkout default moves from 30s to 600s, so your Unity checkout should get through with no configuration at all. They're deliberately independent of PR_AF_MAX_DURATION_SECONDS: that budget clock only starts once the workspace is resolved, so tying the git ceilings to it would have been misleading. One thing worth knowing for your setup specifically: both compose files listed their environment: explicitly, so anything you set in the .env next to them was being dropped — they now forward these variables through.
On LFS, definitively: smudge does not run. The runtime image installs git with --no-install-recommends, and the Debian git package neither depends on nor recommends git-lfs. On top of that pr-af now exports GIT_LFS_SKIP_SMUDGE=1 on every git command it runs, so it stays true in a derived image or with a mounted gitconfig rather than being an accident of the base image. LFS-tracked files land as pointer files, which is all the review needs — it reads the diff and the source text. If you do want real content, install git-lfs in a derived image and set GIT_LFS_SKIP_SMUDGE=0; your value is passed through untouched, and you'll want to raise the checkout ceiling to cover the download. All of this is in the README now.
Your logs pointed at two more things that are fixed in the same PR. The clone/checkout ran inline on the agent's event loop, which is why the node stopped answering /health and got marked inactive while it worked. And a timed-out git left its git-lfs child alive holding the pipes — measured at 46s for a 30s ceiling against a real Unity LFS repo, still downloading after the reasoner had failed — which is almost certainly the "stalling for several minutes before the failure surfaces" you saw. Git now runs in its own process group and the group is killed, with the leftover index.lock removed so a retry with a bigger ceiling isn't blocked by it.
Validated end to end against Unity-Technologies/BoatAttack PR #216 (948 MB of LFS content at the head): with defaults, clone + checkout in 1.5s with pointer files and nothing downloaded; with git-lfs installed and smudge enabled, a 30s ceiling reproduces your failure and now surfaces at 31s with no orphan left behind, and at 900s the full 990 MB tree checks out in 135s.