fix(vscode): inherit model selection for new chat tabs#2802
Conversation
Carry the active pane model into a newly opened editor chat tab. Add regression coverage for the handler, command, and provider session initialization flow.
📋 Review SummaryThis PR fixes issue #2794 by preserving the active model selection when opening a new VS Code chat tab. The implementation threads the 🔍 General Feedback
🎯 Specific Feedback🟢 Medium
🔵 Low
✅ Highlights
|
Code Coverage Summary
CLI Package - Full Text ReportCore Package - Full Text ReportFor detailed HTML reports, please see the 'coverage-reports-22.x-ubuntu-latest' artifact from the main CI run. |
TLDR
Preserve the active model selection when opening a new VS Code chat tab so new panes no longer fall back to the default model.
Screenshots / Video Demo
N/A — this is a small VS Code companion behavior fix. No visual capture was recorded in this CLI workflow.
Dive Deeper
The bug was caused by dropping the selected
modelIdwhen the webview requestedopenNewChatTab. The new editor-tab provider always booted a fresh session with default model state.This change threads the active
modelIdthrough the new-tab flow:Apppasses the current pane model into the new-session actionuseSessionManagementincludes that model in theopenNewChatTabmessageSessionMessageHandlerforwards it toqwenCode.openNewChatTabWebViewProviderstores the requested model and applies it after the new session is readyRegression coverage was added for the message handler, command registration, and provider initialization flow.
Reviewer Test Plan
glm-5.npm --workspace packages/vscode-ide-companion test -- src/commands/index.test.ts src/webview/handlers/SessionMessageHandler.test.ts src/webview/providers/WebViewProvider.test.tsnpm --workspace packages/vscode-ide-companion run check-typesTesting Matrix
Linked issues / bugs
Resolves #2794