Skip to content

Git helper subprocesses need timeouts and captured-output caps #2832

Description

@Widthdom

Summary

Git helper commands drain stdout and stderr concurrently, but the child process has no timeout and captured output grows without bound. A hung git command, broken wrapper, pathological repository, or unexpectedly large output can hang cdidx or consume memory.

Evidence

  • src/CodeIndex/Cli/GitHelper.cs:668 centralizes git subprocess capture.
  • src/CodeIndex/Cli/GitHelper.cs:674 and src/CodeIndex/Cli/GitHelper.cs:675 append all stdout and stderr lines to StringBuilder without a cap.
  • src/CodeIndex/Cli/GitHelper.cs:684 calls process.WaitForExit() with no timeout.

Expected

Git subprocess helpers should have a bounded runtime and bounded captured output, returning a clear diagnostic when either limit is hit.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions