Repository navigation
fix(coding-agents): capture background git stderr - #4334
Merged
nicoloboschi merged 1 commit intoSep 15, 2026
Merged
Conversation
Keep failed Git probes from writing directly into the host TUI while preserving fallback results and error diagnostics. Cover all four synchronous Git call sites with real-process regression tests. Fixes vectorize-io#4328
nicoloboschi
approved these changes
Sep 15, 2026
nicoloboschi
added a commit
that referenced
this pull request
Sep 29, 2026
…erminal (#4918) * fix(coding-agents): keep foreign survey-baseline git errors off the terminal (#4525) The session-start fatal lines came from execFileSync forwarding git stderr; #4334 already captures it in git(), status and session-start (shipped in 0.7.0, the reporter runs 0.6.1). This pins the shared-bank case with a regression test and closes the last uncaptured call, deepen's rev-list, which install runs with inherited stdio. * test(coding-agents): guard every git call against leaking stderr Review fix: the deepen.ts stdio change had no test. Add a structural test that scans the shipped sources and fails on any execFileSync("git") call that does not capture stderr, so the next new call can't reintroduce #4328/#4525. * test(coding-agents): explain the guard's minimum call count
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Fixes #4328.
Capture stderr explicitly for background Git subprocesses in the coding-agents integration. With
execFileSync, catching an error does not stop Node from forwarding the failed child's stderr to the host process whenstdiois omitted. In Pi, that output can corrupt the TUI.The change covers the shared Git helper, sync-status commit count, incremental-sync helper, and the late commit count used for the session-start full-sync banner. Stdout, error status, and captured error diagnostics remain available; existing fallback values and ingestion errors are preserved.
This is intentionally limited to stderr isolation. It does not change
autoSeed,gitIngest, survey defaults, or introduce a cached repository probe.Regression coverage
Five tests run the actual core code with real Git subprocesses inside a child Node process and assert that the host's stderr is empty. They cover non-repository fallbacks, retained diagnostics on a propagated ingestion failure, sync status, best-effort fetch/ref fallback, and a repository disappearing before the session-start banner's late commit count.
The tests inspect process stderr rather than mocking
console.error, which would miss this failure.Validation
From
hindsight-integrations/coding-agents, on Linux with Node 24.15.0:npm test: 1,022 passed across 73 files (the package's standard command excludes live E2E tests).npx tsc --noEmit: passed.npm run build: passed.Also checked all changed files with Prettier and
git diff --check. The five new tests failed before the fix and passed after it. Temporarily removing the shared helper'sstdiosetting made two regression tests fail again; restoring it returned all five to green.Windows targeted tests passed (54 tests), as did type checking and build. The Windows full suite has existing path/permission failures, reproduced on an unchanged LF checkout of the same upstream commit; the CRLF checkout also has docs-fixture failures. The monorepo lint script could not run from that CRLF checkout, so this does not claim a full-monorepo lint pass. No tests were weakened or skipped to obtain the Linux package result.
This verifies the subprocess boundary and the shared Pi session-start path, not a manual interactive Pi session.
Review guide
The production diff only adds explicit stdio settings and comments at four Git call sites.
src/core/git-stderr.test.tscontains the real-process regressions. There are no dependency, API, configuration, or generated-file changes.