Repository navigation
fix(fm-spawn): prevent crewmate git-editor deadlocks with GIT_EDITOR=true - #49
Conversation
A crewmate has no terminal a human can type into, but it inherits the machine's configured git editor. On this machine that is `code --wait`, which blocks until a human closes the tab. Any git command that opens an editor - `rebase --continue`/`-i`, `commit` without `-m`, non-ff `merge`, `revert`, `tag -a`, `cherry-pick --continue` - therefore hangs forever with no output and no error. The pane looks identical to a thinking pane, so nothing surfaces it until the staleness window expires, and the agent's natural response (retry) stacks more orphaned waiters on the same file. Observed live on task parlay-45-rebase: three wedged attempts, ~15 min lost, resolved only by killing the editor waiters by hand. Two layers, both here: - fm-spawn now exports GIT_EDITOR=true and GIT_SEQUENCE_EDITOR=true into the crewmate's pane shell alongside GOTMPDIR, before the harness launch, so the whole class is impossible rather than each worker remembering. `true` exits 0 without touching the file, so git proceeds with the commit message or rebase todo as written. - fm-brief adds rule 8 to both the scout and ship Rules sections: never let git open an editor, and treat a git command that is silent for over a minute as a blocked editor rather than a slow operation. Also lands the fix violation-0gh asks for, since it is the same one-line brief addition: ship rule 9 tells a worker whose branch is already checked out elsewhere to use a detached HEAD, never to remove or modify another worktree. New rules are appended rather than inserted so the existing "rule 6" cross-reference in the ship brief stays correct. Covered by a new pane-export assertion in tests/fm-kimi-harness.test.sh, which owns fm-spawn's pane environment contract.
|
Warning Review limit reached
Next review available in: 8 minutes You've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository. How can I continue?After more reviews become available, a review can be triggered using the To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based reviews. How do review limits work?CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability. For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window. Please refer docs for additional details. Review details⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Plus Run ID: 📒 Files selected for processing (3)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
…true (#49) * fix(spawn): give crewmates non-interactive git editors (robots-1xw8) A crewmate has no terminal a human can type into, but it inherits the machine's configured git editor. On this machine that is `code --wait`, which blocks until a human closes the tab. Any git command that opens an editor - `rebase --continue`/`-i`, `commit` without `-m`, non-ff `merge`, `revert`, `tag -a`, `cherry-pick --continue` - therefore hangs forever with no output and no error. The pane looks identical to a thinking pane, so nothing surfaces it until the staleness window expires, and the agent's natural response (retry) stacks more orphaned waiters on the same file. Observed live on task parlay-45-rebase: three wedged attempts, ~15 min lost, resolved only by killing the editor waiters by hand. Two layers, both here: - fm-spawn now exports GIT_EDITOR=true and GIT_SEQUENCE_EDITOR=true into the crewmate's pane shell alongside GOTMPDIR, before the harness launch, so the whole class is impossible rather than each worker remembering. `true` exits 0 without touching the file, so git proceeds with the commit message or rebase todo as written. - fm-brief adds rule 8 to both the scout and ship Rules sections: never let git open an editor, and treat a git command that is silent for over a minute as a blocked editor rather than a slow operation. Also lands the fix violation-0gh asks for, since it is the same one-line brief addition: ship rule 9 tells a worker whose branch is already checked out elsewhere to use a detached HEAD, never to remove or modify another worktree. New rules are appended rather than inserted so the existing "rule 6" cross-reference in the ship brief stays correct. Covered by a new pane-export assertion in tests/fm-kimi-harness.test.sh, which owns fm-spawn's pane environment contract. * no-mistakes: apply CI fixes
…true (#49) * fix(spawn): give crewmates non-interactive git editors (robots-1xw8) A crewmate has no terminal a human can type into, but it inherits the machine's configured git editor. On this machine that is `code --wait`, which blocks until a human closes the tab. Any git command that opens an editor - `rebase --continue`/`-i`, `commit` without `-m`, non-ff `merge`, `revert`, `tag -a`, `cherry-pick --continue` - therefore hangs forever with no output and no error. The pane looks identical to a thinking pane, so nothing surfaces it until the staleness window expires, and the agent's natural response (retry) stacks more orphaned waiters on the same file. Observed live on task parlay-45-rebase: three wedged attempts, ~15 min lost, resolved only by killing the editor waiters by hand. Two layers, both here: - fm-spawn now exports GIT_EDITOR=true and GIT_SEQUENCE_EDITOR=true into the crewmate's pane shell alongside GOTMPDIR, before the harness launch, so the whole class is impossible rather than each worker remembering. `true` exits 0 without touching the file, so git proceeds with the commit message or rebase todo as written. - fm-brief adds rule 8 to both the scout and ship Rules sections: never let git open an editor, and treat a git command that is silent for over a minute as a blocked editor rather than a slow operation. Also lands the fix violation-0gh asks for, since it is the same one-line brief addition: ship rule 9 tells a worker whose branch is already checked out elsewhere to use a detached HEAD, never to remove or modify another worktree. New rules are appended rather than inserted so the existing "rule 6" cross-reference in the ship brief stays correct. Covered by a new pane-export assertion in tests/fm-kimi-harness.test.sh, which owns fm-spawn's pane environment contract. * no-mistakes: apply CI fixes
Intent
Fix robots-1xw8: crewmate git commands hang forever because they inherit the machine git editor
code --wait, which blocks until a human closes a VS Code tab. Crewmates have no human at a terminal, sogit rebase --continue/-i,git commitwithout -m, non-fast-forwardgit merge,git revert,git tag -a, andgit cherry-pick --continueall wedge silently with no output and no error. Observed live on task parlay-45-rebase: three stacked orphaned editor waiters on the same COMMIT_EDITMSG, ~15 minutes lost; killing the waiters let the rebase complete and push cleanly, so it was purely an editor deadlock and no work was ever at risk. A wedged pane is indistinguishable from a thinking pane, and the agents natural response (retry) stacks more waiters, making it worse.The ticket prescribes two layers and asks for both. Layer 1 (the real fix): bin/fm-spawn.sh exports GIT_EDITOR=true and GIT_SEQUENCE_EDITOR=true into every crewmates pane shell, so the whole class becomes impossible instead of each worker having to remember. It is deliberately placed next to the existing GOTMPDIR pane export and before the harness launch, because that is the established point where pane environment must be set for the agent and all its children to inherit it.
trueexits 0 without touching the file, so git proceeds with the commit message or rebase todo as written rather than waiting. Layer 2 (belt and braces): bin/fm-brief.sh gains a Rules entry in BOTH the scout and ship scaffolds telling the worker never to let git open an editor and to treat a git command silent for over a minute as a blocked editor rather than a slow operation.Deliberate decisions a reviewer would not see in the diff:
Validation already run locally: bin/fm-lint.sh clean, bin/fm-doc-audience-check.sh clean, and bin/fm-test-run.sh --changed --base origin/main over 36 scripts. Three failures there were each reproduced on clean origin/main with the change stashed, so they are pre-existing and unrelated: fm-arm-pretool-check "A13 via codex must allow", fm-calm-pi-extension "loaded_off case rendered a duplicate captain answer" (live-pi E2E), and fm-test-run "scheduler waited for oldest worker" (timing-sensitive 0.5s vs 0.05s fixtures; passes when run alone, flakes under a 36-script load).
An earlier attempt raised this as PR #48 directly with
gh pr create; the Require no-mistakes gate correctly rejected it and it was closed, which is why this is coming through the pipeline instead.What Changed
bin/fm-spawn.shnow exportsGIT_EDITOR=trueandGIT_SEQUENCE_EDITOR=trueinto every crewmate pane shell before the agent starts, preventingcode --wait-style editor hangs onrebase --continue,commitwithout-m, non-fast-forward merges,revert,tag -a, andcherry-pick --continue.bin/fm-brief.shgains a rule 8 in both scout and ship scaffolds instructing crewmates never to let git open an editor (with fallback diagnostics), and a ship-only rule 9 forbidding removal of sibling worktrees when a branch-checked-out conflict occurs.tests/fm-kimi-harness.test.shextends the existing pane-environment contract test to assert that the newGIT_EDITORexport appears in the tmux-calls log.Risk Assessment
✅ Low: Both fix layers are minimal and well-bounded: a two-variable unconditional export before agent launch in fm-spawn.sh, and two appended rules that cannot break existing numbered cross-references in fm-brief.sh.
Testing
Ran the fm-kimi-harness suite (17 tests, 28s). The new assertion in
test_kimi_launch_then_send_is_verifiedconfirms fm-spawn.sh actually emits the git-editor export to the pane — the core behavioral contract for Layer 1. All 17 tests passed; no failures.Evidence: fm-kimi-harness test output
FM_TEST_BEGIN 2026-08-05T10:34:55Z tests/fm-kimi-harness.test.sh family=pure-contract-unit ok - fm-spawn: kimi launches, delivers its brief, and registers a guarded turn-end token [16 other tests] FM_TEST_END exit=0 duration_ms=27898 FM_TEST_SUMMARY total=1 failed=0Pipeline
Updates from git push no-mistakes
✅ **intent** - passed
✅ No issues found.
✅ **Rebase** - passed
✅ No issues found.
✅ **Review** - passed
✅ No issues found.
✅ **Test** - passed
✅ No issues found.
bin/fm-test-run.sh tests/fm-kimi-harness.test.sh— 17 tests passed includingtest_kimi_launch_then_send_is_verified, which assertsexport GIT_EDITOR=true GIT_SEQUENCE_EDITOR=trueappears in tmux-calls.log (the observable pane-environment contract)✅ **Document** - passed
✅ No issues found.
✅ **Lint** - passed
✅ No issues found.
✅ **Push** - passed
✅ No issues found.