Skip to content

[Bug]: Auggie CLI MCP Mode Orphaned Processes Enter Infinite CPU Loop #63

@dancingmadkefka

Description

@dancingmadkefka

What happened?

Bug report written by Claude Opus 4.5. I'm sure he did a lot better than I would have done!

Summary

When using auggie --mcp as an MCP server for AI coding tools in VSCode, the auggie processes do not terminate when their parent (the MCP client) disconnects. Instead, they become orphaned and enter an infinite CPU loop, consuming 100% CPU per instance indefinitely.

Bug Description

What Happens

  1. AI extensions (Cline, Roo Code, Continue, Copilot, etc.) spawn auggie --mcp as stdio-based MCP servers
  2. Multiple instances are created (one per workspace/project)
  3. When VSCode closes or the extension disconnects, the parent process dies
  4. Auggie processes do NOT exit - they become orphaned
  5. Orphaned processes enter an infinite CPU loop, each consuming ~100% CPU
  6. Processes persist indefinitely until manually killed

Evidence from Live System

When discovered, 13 auggie instances were running:

  • 8 processes had accumulated 53,000+ CPU seconds each (~14.7 hours)
  • Total CPU time burned: 118+ hours
  • All 8 "old" processes were consuming 90-100% CPU each
  • Parent PIDs no longer existed (orphaned)
PID   CPU_Hours  Command
52376    14.8    node augment.mjs --mcp -m default
51068    14.8    node augment.mjs --mcp
24940    14.8    node augment.mjs --mcp -m default
45012    14.8    node augment.mjs --mcp
...

Root Cause Hypothesis

The auggie --mcp mode does not properly handle:

  1. Stdin EOF/disconnect - When the parent process dies, stdin closes but auggie doesn't exit
  2. SIGTERM/SIGHUP signals - Standard termination signals may not be handled in MCP mode
  3. Stdio pipe broken - The process should exit when its stdio pipes are closed

Instead of exiting gracefully, the process appears to enter a busy-wait loop or infinite retry loop.

Impact

  1. System Unresponsiveness: Multi-second UI hangs, mouse-only response
  2. CPU Saturation: All cores consumed by runaway processes
  3. Thermal Stress: Sustained high temperatures, fan noise
  4. Hardware Stress: Triggered WHEA CPU errors (machine check exceptions) due to load
  5. Power Waste: ~15 kWh electricity wasted
  6. User Frustration: Hours of troubleshooting what appeared to be hardware instability

Workaround

Kill orphaned auggie processes manually:

# PowerShell - find and kill all auggie MCP processes
Get-CimInstance Win32_Process | 
    Where-Object { $_.CommandLine -match 'auggie.*--mcp' } | 
    ForEach-Object { Invoke-CimMethod -InputObject $_ -MethodName Terminate }

Note: Standard taskkill /F may not work; WMI Terminate is more reliable.

Suggested Fix

In the MCP server mode initialization (augment.mjs), add:

// Handle stdin close (parent disconnect)
process.stdin.on('end', () => {
    console.error('MCP client disconnected, shutting down');
    process.exit(0);
});

process.stdin.on('close', () => {
    process.exit(0);
});

// Handle broken pipe
process.stdout.on('error', (err) => {
    if (err.code === 'EPIPE') {
        process.exit(0);
    }
});

// Handle termination signals
['SIGTERM', 'SIGINT', 'SIGHUP'].forEach(signal => {
    process.on(signal, () => {
        process.exit(0);
    });
});
  • The issue may be exacerbated by having multiple projects with MCP configs, each spawning separate instances
  • This bug report was generated with diagnostic assistance from Claude

Related


For lolz: See pics :D:D
Image

Image

What did you expect to happen?

Expected Behavior

When the MCP client (parent process) disconnects:

  1. Auggie should detect stdin EOF or pipe closure
  2. Auggie should gracefully shutdown
  3. Process should exit with code 0
  4. No orphaned processes should remain

Steps to reproduce

Steps to Reproduce

  1. Install auggie globally: npm install -g @augmentcode/auggie
  2. Login: auggie login
  3. Configure a VSCode project with .vscode/mcp.json pointing to auggie --mcp
  4. Install an AI extension that uses MCP (Cline, Continue, Roo Code, etc.)
  5. Open VSCode, use the AI features (spawns auggie)
  6. Close VSCode abruptly (or let the extension crash)
  7. Check Task Manager - auggie/node processes should still be running
  8. Wait and observe CPU usage climbing

Auggie version

0.13.0-prerelease.2 (commit 7ce9fef2)

Request ID

N/A

Environment details

Environment
  • OS: Windows 11 Pro (Build 26200)
  • Shell: Git Bash
  • Tool/CLI version: - Auggie CLI: @augmentcode/auggie (installed via npm global)
  • Node.js: v22.x
  • VSCode: 1.107.1
  • MCP Clients: Multiple AI extensions using auggie as context engine
  • CPU: Intel Core i5-13600K (14 cores, 20 threads)

Configuration

Multiple projects configured with .vscode/mcp.json:

{
  "servers": {
    "augmentcode": {
      "type": "stdio",
      "command": "auggie",
      "args": ["--mcp", "-m", "default"]
    }
  }
}

Anything else we need to know?

My system instability and high fan/cpu happened since installing auggie and using the MCP. Claude killing the zombie processes properly really fdixed it and brought my CPU to idle. I guess those zombie processes are just since the last restart, so probably have burned 10x that CPU time and money on this!

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions