microsoft / microsoft/intelligent-terminal

Switching from Copilot to Claude can corrupt the shared npx ACP adapter cache during concurrent helper initialization

Open
#682 0 comments 0 reactions 1 assignee Claimed by @vanzue View on GitHub
Issue-Bug Needs-Triage
Dominant language
C++
Stars
2k
Forks
159
Avg merge
21h 42m
Merged PRs (30d)
120

Description

### Intelligent Terminal version

0.2.2393.0

### Windows build number

10.0.26100.0

### Other Software

Claude Code 2.1.159
Node.js 22.17.0
npm 10.9.2
@agentclientprotocol/claude-agent-acp 0.65.0

### Steps to reproduce

1. Open Intelligent Terminal with multiple tabs, each with a pre-warmed agent-pane helper.
2. Configure Copilot as the current ACP agent.
3. In Settings, switch the ACP agent from Copilot to Claude.
4. Allow multiple existing helpers to reconnect to the new agent concurrently.

### Expected Behavior

The helpers should reconnect to a working Claude ACP process. Concurrent helpers should not race while npx is downloading or extracting the pinned ACP adapter.

### Actual Behavior

Both helpers reconnect at nearly the same time and resolve the same command:

npx -y @agentclientprotocol/claude-agent-acp@0.65.0

The shared npx cache becomes incomplete. The master log reports multiple extraction failures such as:

npm warn tar TAR_ENTRY_ERROR ENOENT

The generated file below is truncated to exactly 4096 bytes and ends in the middle of an expression on line 99:

C:\.tools\.npm\_npx\\node_modules\@agentclientprotocol\sdk\dist\acp.js
writeTextFile: schema.CLIE

Node then exits before replying to ACP initialize:

SyntaxError: Unexpected end of input
response to `initialize` never received: oneshot canceled

The agent pane displays:

helper ACP transport failed on reconnect: initialize over master pipe failed: handshake failed at initialize: Unable to start the selected AI agent.

Timeline from the logs:

- Two helpers begin Agent rebind to `claude` at approximately the same time.
- Both resolve the same pinned npx command and shared cache directory.
- npm extracts files into that directory and emits TAR_ENTRY_ERROR/ENOENT warnings.
- The adapter loads the truncated ACP SDK file and crashes.
- Both helper handshakes fail.

Deleting the affected `_npx\` directory and allowing a clean single download repairs the local installation. Claude Code itself is installed and functional, so this does not appear to be an authentication or model-provider configuration failure.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.