Skip to content

The copilot session becomes completly unresponsive due to heavy start #1681

@Felixoid

Description

@Felixoid

Describe the bug

GitHub Copilot CLI v0.0.417 experiences a critical process management failure when SnapshotManager encounters directories with large numbers of untracked files.

The copilot interactive TUI becomes completely unresponsive for minutes.

Investigating with another copilot session gave the next insights:

Problem ✗

GitHub Copilot CLI hung with unresponsive terminal when launched in OrcaSlicer directory, spawning 10,000+ zombie git processes.

Root Cause 🔍

Untracked build directories (broken-build/ and vanila-build/, 12,000+ files total) caused Copilot's SnapshotManager to invoke git hash-object 6,172 times, creating zombie processes faster than they could be reaped.

Solution ✓

Removed the untracked build directories:

rm -rf broken-build/
rm -rf vanila-build/

Investigation Method 🔬

  1. Observed: 11,900 zombie [git] processes with sequential PIDs
  2. Traced: Found 6,172 git hash-object calls via wrapper script
  3. Identified: Root in untracked build directory traversal
  4. Fixed: Removed problematic directories

Result ✅

  • Copilot now launches and responds normally
  • No zombie processes
  • Terminal I/O fully responsive
  • Verified working with test queries

Affected version

0.0.417

Steps to reproduce the behavior

git clone git@github.com:OrcaSlicer/OrcaSlicer.git repro-copilot
cd repro-copilot
mkdir git-wrapper -p
cat > git-wrapper/git << 'EOF'
#!/bin/bash
echo "[GIT CALL] $@" >> /tmp/git-calls.log
exec /usr/bin/git "$@"
EOF
chmod +x git-wrapper/git
# create big number of untracked files
cp /usr/bin . -r
for i in {1..20}; do cp bin bin_$i -r; done
# After that, start the copilot with the git wrapper
PATH="./git-wrapper:$PATH" copilot

The log /tmp/git-calls.log full of lines like [GIT CALL] hash-object -- $DIR/repro-copilot/bin/pyreverse, the interface is completely hanged

Expected behavior

  • SnapshotManager should quickly create a snapshot of repository state
  • Copilot should be responsive within seconds
  • No zombie processes should accumulate
  • Terminal I/O should remain responsive

Actual behavior

Immediate:

  • Process hangs during initialization
  • Terminal becomes unresponsive
  • Zombie git processes accumulate rapidly

After ~1 minute:

  • 1,000+ [git] <defunct> zombie processes visible in ps
  • CPU usage stays at 40-50% despite no visible work
  • Terminal input is completely ignored

After 5-10 minutes:

  • 5,000-10,000+ zombies accumulate
  • System starts experiencing resource exhaustion
  • Only reset command restores terminal functionality

Additional context

  • Operating system: arch linux
  • Terminal emulator: tested alacritty, wezterm
  • Shell: zsh

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions