-
Notifications
You must be signed in to change notification settings - Fork 10
Description
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
- AI extensions (Cline, Roo Code, Continue, Copilot, etc.) spawn
auggie --mcpas stdio-based MCP servers - Multiple instances are created (one per workspace/project)
- When VSCode closes or the extension disconnects, the parent process dies
- Auggie processes do NOT exit - they become orphaned
- Orphaned processes enter an infinite CPU loop, each consuming ~100% CPU
- 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:
- Stdin EOF/disconnect - When the parent process dies, stdin closes but auggie doesn't exit
- SIGTERM/SIGHUP signals - Standard termination signals may not be handled in MCP mode
- 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
- System Unresponsiveness: Multi-second UI hangs, mouse-only response
- CPU Saturation: All cores consumed by runaway processes
- Thermal Stress: Sustained high temperatures, fan noise
- Hardware Stress: Triggered WHEA CPU errors (machine check exceptions) due to load
- Power Waste: ~15 kWh electricity wasted
- 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
- MCP SDK has known memory leak issues: **Memory Leak** in MCP Server – will be a memory leak until OOM (Out of Memory) occurs modelcontextprotocol/python-sdk#1076
- MCP servers in general need better lifecycle management
What did you expect to happen?
Expected Behavior
When the MCP client (parent process) disconnects:
- Auggie should detect stdin EOF or pipe closure
- Auggie should gracefully shutdown
- Process should exit with code 0
- No orphaned processes should remain
Steps to reproduce
Steps to Reproduce
- Install auggie globally:
npm install -g @augmentcode/auggie - Login:
auggie login - Configure a VSCode project with
.vscode/mcp.jsonpointing toauggie --mcp - Install an AI extension that uses MCP (Cline, Continue, Roo Code, etc.)
- Open VSCode, use the AI features (spawns auggie)
- Close VSCode abruptly (or let the extension crash)
- Check Task Manager - auggie/node processes should still be running
- 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!
