Skip to content

fix(git): stop Windows Git children after stdout overflow - #695

Merged
moreih29 merged 1 commit into
developfrom
fix/git-overflow-cleanup
Nov 19, 2026
Merged

moreih29 merged 1 commit into
developfrom
fix/git-overflow-cleanup

Conversation

@moreih29

Copy link
Copy Markdown
Owner

Summary

TestRunStdoutOverflowIsClassifiedData failed on the Windows agent runner during #694 (a TS-only PR): the test passed, then t.TempDir cleanup could not remove the working directory.

Cause: since #687, git.run cancels as soon as stdout passes its cap. On Windows the Go process only kills the Git for Windows launcher (git.exe wrapper); the real Git child it started keeps running for a moment and still holds the working directory as its cwd.

Fix (Windows only):

  • git.run starts Git suspended, assigns it to a job object before resuming it, and on stdout overflow terminates the job and waits (up to the existing WaitDelay) on the process handles captured before termination, so the tree is gone when Run returns.
  • On success the job is released without killing anything.
  • ResumeSuspended moves from internal/chat to internal/process so chat and git share it; TerminateJobAndWait and the job process-id list live there too.
  • Unix keeps cmd.Run() unchanged.

Tests: the existing overflow test now uses a fake launcher and child, and checks that the cwd can be removed right after Run. No new test files.

Checks

  • go vet ./..., GOOS={windows,linux,darwin} go build ./..., GOOS=windows go test -c for git/process/chat, go test -count=1 ./...: pass locally.
  • Windows execution: CI.

🤖 Generated with Claude Code

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@moreih29
moreih29 merged commit f4ba85e into develop Nov 19, 2026
25 of 27 checks passed
@moreih29
moreih29 deleted the fix/git-overflow-cleanup branch November 19, 2026 15:18
@moreih29 moreih29 mentioned this pull request Nov 19, 2026
1 of 2 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant