Skip to content

[BUG] VSCode: closing chat tab does not terminate ACP child process, causing orphan processes #2665

@zhangxy-zju

Description

@zhangxy-zju

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:

  1. Open VSCode with the Qwen Code extension installed
  2. Open a Qwen Code chat tab
  3. Verify CLI process is running: ps aux | grep -E 'qwen.*acp.*VSCode' | grep -v grep
  4. Close the chat tab
  5. 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)

Metadata

Metadata

Assignees

Labels

scope/ideIDE integration generaltype/bugSomething isn't working as expected

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions