-
Notifications
You must be signed in to change notification settings - Fork 2k
[BUG] VSCode: closing chat tab does not terminate ACP child process, causing orphan processes #2665
Description
What happened?
When using the Qwen Code VSCode extension, closing a chat tab (either the editor panel or the sidebar view) leaves the ACP CLI child process running as an orphan. The process persists indefinitely until VSCode is fully quit or the process is manually killed.
Steps to reproduce:
- Open VSCode with the Qwen Code extension installed
- Open a Qwen Code chat tab
- Verify CLI process is running:
ps aux | grep -E 'qwen.*acp.*VSCode' | grep -v grep - Close the chat tab
- Check again — the CLI process is still running
With heavy usage (multiple tabs, frequent open/close), orphan processes accumulate.
Root cause
WebViewProvider's panel onDidDispose and sidebar view onDidDispose callbacks do not call agentManager.disconnect(). Only WebViewProvider.dispose() (triggered on extension deactivation) has the disconnect call. Closing a tab triggers onDidDispose on the panel/view, not WebViewProvider.dispose(), so the CLI child process never receives SIGTERM.
What did you expect to happen?
Closing the chat tab should terminate the associated CLI child process.
Client information
- VSCode extension version: 0.13.0
- OS: macOS (darwin arm64)