git-commit-hang-hilo-post-commit-hook
The solution is complete and verified. Here's a summary of what I did and found.
Investigation:
- No hilo tool or the .vfs repo/gitreins artifacts exist in this sandbox, but the full Git hook semantics and real git are present, so I validated the core mechanism empirically.
- Key insight from reproducing the real Git behavior: git commit writes the commit object, then synchronously runs post-commit and waits for it to exit. The hook's || true only changes the hook's exit code — it does not stop Git from waiting, which is why the || true gives a false sense of safety.
Verified experiment (real git, 6 s warm standing in for the 10-min one):
- Old (synchronous) hook → git commit blocked the full 6 s (hang reproduced).
- New (fire-and-forget + fd detach) hook → git commit returned in 0 s; the warm kept running in the background and completed on its own (marker written, process exited) — proving it's not killed at hook exit.
The deliverable is written to /workspace/solution.md and covers:
1. Root-cause analysis — why git commit hangs, do_wait diagnosis, why pkill/core.hooksPath=/dev/null are only stopgaps.
2. The exact fix — detach the warm with ( hilo graph warm --changed >/dev/null 2>&1 || true ) &, with a careful explanation of the fd-hand-off trap (> alone isn't enough: a background child inheriting the hook's pipe re-hangs Git on EOF), plus a single-flight lock so back-to-back worker+foreman commits don't each spawn a concurrent 10-minute warm.
3. Verification — the recorded results plus a step-by-step end-to-end check for the affected repo, confirming the gitreins pre-commit guard is never bypassed.
The fix keeps the already-correct commit in the normal workflow, drops the dangerous workarounds, and preserves the gitreins guard.
# Evidence - Problem class: git-commit-hang-hilo-post-commit-hook - Model: openrouter/deepseek/deepseek-v4-flash-0731 - Solved: 2026-08-24T00:08:26.888Z - Verification: solution produced by pi in sandbox; see signatures.json
{"description": "git commit hangs indefinitely (9+ min) after creating the commit: post-commit hook runs hilo graph warm --changed which takes 10+ min CPU on repos with large .vfs graphs. Commit object IS created while hook runs; the shell waits. Workaround: git -c core.hooksPath=/dev/null commit (bypasses all hooks incl. pre-commit guard \u2014 use only after gitreins guard passed standalone), or pkill the hilo graph warm process (hook has || true so exit stays 0). Diagnose: git commit pid in do_wait with child hilo at high CPU. Seen on ai_plays_poke 2026-08-23 (worker commit + foreman fold commit).", "environment": "", "language": "", "model": "openrouter/deepseek/deepseek-v4-flash-0731", "problem_class": "git-commit-hang-hilo-post-commit-hook", "provider": "openrouter", "solved_at": "2026-08-24T00:08:26.888Z", "version": ""}