# Pull Request: Add Chat Interface to VSCode IDE Companion
## TLDR
Added Chat interface to VSCode IDE Companion with support for interactive conversations with Qwen CLI, session management, and streaming responses.
**Key Changes**:
- Added WebView-based Chat UI with communication to Qwen CLI
- Support for viewing, switching, and managing session lists
- Real-time streaming message display
## Dive Deeper
**New Modules**:
- `packages/vscode-ide-companion/src/acp/AcpConnection.ts` - ACP JSON-RPC protocol implementation
- `packages/vscode-ide-companion/src/agents/QwenAgentManager.ts` - Qwen Agent lifecycle management
- `packages/vscode-ide-companion/src/services/QwenSessionReader.ts` - Read local Qwen session files (`~/.qwen/tmp/`)
- `packages/vscode-ide-companion/src/storage/ConversationStore.ts` - Conversation history persistence (VSCode GlobalState)
- `packages/vscode-ide-companion/src/WebViewProvider.ts` - WebView lifecycle management
- `packages/vscode-ide-companion/src/webview/` - React chat UI components
**Build Configuration**:
- Updated `esbuild.js` to support dual-entry bundling (extension + webview)
- Configured CSS injection plugin for stylesheet handling
- Using React 18's new JSX transform (`jsx: "react-jsx"`)
## Reviewer Test Plan
## Testing Matrix
### Prerequisites
1. Ensure Qwen CLI is installed: `npm install -g @qwen/qwen-code`
2. Configure Qwen authentication (OpenAI API Key or Qwen OAuth)
### Test Steps
#### 1. Basic Functionality Test
##### Build Extension
```bash
cd packages/vscode-ide-companion
npm run build
```
#### 2. Session Management Test
- [ ] Click "📋 Sessions" button
- [ ] Verify existing session list is displayed
- [ ] Click "➕ New Session" to create a new session
- [ ] Switch to a historical session and verify messages load correctly
#### 3. Tool Permission Test
- [ ] Send a request requiring file operations: "Create a new file hello.txt"
- [ ] Verify permission request popup appears
- [ ] Test allow/reject functionality
| | 🍏 | 🪟 | 🐧 |
| -------- | --- | --- | --- |
| npm run | ✅ | ❓ | ❓ |
| npx | ❓ | ❓ | ❓ |
| Docker | ❓ | ❓ | ❓ |
| Podman | ❓ | - | - |
| Seatbelt | ❓ | - | - |
## Linked issues / bugs