Switching an LM Studio model in a reused chat retains the previous model identity and system prompt
- Dominant language
- TypeScript
- Stars
- 193k
- Forks
- 42.4k
- PR merge metrics
- PR metrics pending
Description
Type: Bug
### Environment
- VS Code: 1.136.1
- GitHub Copilot Chat: 0.64.1
- OS: Windows
- Provider: LM Studio through an OpenAI-compatible endpoint
- Original registered model: `prism-ml/bonsai-27b`
- Model subsequently loaded by LM Studio: `google/gemma-4-12b-qat`
- Custom agent/subagent workflow using VS Code custom agents
### Steps to reproduce
1. Configure an LM Studio OpenAI-compatible model in VS Code/Copilot Chat.
2. Start a Copilot chat while LM Studio is serving `prism-ml/bonsai-27b`.
3. Send a request that invokes a custom agent or subagent.
4. In LM Studio, switch the loaded model to `google/gemma-4-12b-qat`.
5. Reuse the existing Copilot chat.
6. Send another request that invokes a custom agent or subagent.
7. Compare the Copilot debug logs with the LM Studio server logs.
### Actual behavior
LM Studio reports that all requests after the switch were processed by
`google/gemma-4-12b-qat`.
However, the Copilot debug logs continue to identify every outer and subagent
request as:
`prism-ml/bonsai-27b`
The reused session also continues using the original `system_prompt_0.json`.
No new system prompt or tool snapshot is generated after switching models.
The retained system prompt explicitly says:
> When asked about the model you are using, you must state that you are using Bonsai-27b.
Therefore, this appears to affect more than logging. Gemma is apparently sent
model-specific instructions retained from the previously selected model.
The model field in the request metadata also remains
`prism-ml/bonsai-27b`, while LM Studio confirms that Gemma handled the actual
HTTP requests.
Subagents inherit the same stale Bonsai model identity.
### Expected behavior
When the backing provider model changes, Copilot Chat should do one of the
following:
1. Detect the changed model and refresh the model descriptor, system prompt,
tools, capabilities, and debug metadata; or
2. Prevent the existing chat from continuing and require a new chat.
The model identity in Copilot diagnostics should match the model that receives
the request. Model-specific instructions for the previous model should not be
sent to the newly loaded model.
### Workaround
Starting a completely new Copilot chat after changing the model appears to be
the safest workaround.
### Additional evidence
The affected session contains only one system prompt snapshot, created before
the provider switch. Both the original request and the later request reference
that same snapshot and are logged as `prism-ml/bonsai-27b`.
LM Studio independently records the later calls as being processed by
`google/gemma-4-12b-qat`.
VS Code version: Code 1.136.1 (a44adf7f53e00964ab890f9f8758a334f1fc15bc, 2026-09-03T05:06:41Z)
OS version: Windows_NT x64 10.0.19045
Modes:
System Info
|Item|Value|
|---|---|
|CPUs|Intel(R) Core(TM) i7-7700K CPU @ 4.20GHz (8 x 4200)|
|GPU Status|2d_canvas: enabled
GPU0: VENDOR= 0x10de, DEVICE=0x2208 [NVIDIA GeForce RTX 3080 Ti], DRIVER_VENDOR=NVIDIA, DRIVER_VERSION=32.0.16.1656 *ACTIVE*
GPU1: VENDOR= 0x1414, DEVICE=0x008c [Microsoft Basic Render Driver], DRIVER_VERSION=10.0.19041.7548
Machine model name:
Machine model version:
direct_rendering_display_compositor: disabled_off_ok
gpu_compositing: enabled
multiple_raster_threads: enabled_on
opengl: enabled_on
rasterization: enabled
raw_draw: disabled_off_ok
skia_graphite: disabled_off
trees_in_viz: disabled_off
video_decode: enabled
video_encode: enabled
webgl: enabled
webgpu: enabled
webnn: disabled_off|
|Load (avg)|undefined|
|Memory (System)|31.96GB (10.45GB free)|
|Process Argv|. --crash-reporter-id 559a39a4-2b22-4e5f-89e1-8c272f54f660|
|Screen Reader|no|
|VM|0%|
Extensions (30)
Name|Identifier|Author|Version
---|---|---|---
Auto-assembler Syntax Highlighting|compeador.cea|compeador|0.1.2
Cheat Engine Lua Intellisense|droidxrx.cheat-engine-lua-intellisense|droidxrx|0.0.3
Go|golang.go|golang|0.56.1
ce_lua_snippet|lamkakyun.ce-lua-snippet|lamkakyun|0.0.2
Auto Build Marlin|marlinfirmware.auto-build|marlinfirmware|2.1.88
GitHub Copilot for Azure|ms-azuretools.vscode-azure-github-copilot|ms-azuretools|1.0.231
Azure MCP Server|ms-azuretools.vscode-azure-mcp-server|ms-azuretools|2.0.46
Azure Resources|ms-azuretools.vscode-azureresourcegroups|ms-azuretools|0.12.7
C# Dev Kit|ms-dotnettools.csdevkit|ms-dotnettools|3.20.199
C#|ms-dotnettools.csharp|ms-dotnettools|2.140.9
.NET Install Tool|ms-dotnettools.vscode-dotnet-runtime|ms-dotnettools|3.1.0
Kubernetes|ms-kubernetes-tools.vscode-kubernetes-tools|ms-kubernetes-tools|1.4.1
Python Debugger|ms-python.debugpy|ms-python|2026.6.0
Python|ms-python.python|ms-python|2026.4.0
Pylance|ms-python.vscode-pylance|ms-python|2026.3.1
Remote - SSH|ms-vscode-remote.remote-ssh|ms-vscode-remote|0.128.0
Remote - SSH: Editing Configuration Files|ms-vscode-remote.remote-ssh-edit|ms-vscode-remote|0.87.0
WSL|ms-vscode-remote.remote-wsl|ms-vscode-remote|0.104.3
CMake Tools|ms-vscode.cmake-tools|ms-vscode|1.23.52
C/C++ DevTools|ms-vscode.cpp-devtools|ms-vscode|0.6.18
C/C++|ms-vscode.cpptools|ms-vscode|1.33.8
C/C++ Extension Pack|ms-vscode.cpptools-extension-pack|ms-vscode|1.5.1
Remote Explorer|ms-vscode.remote-explorer|ms-vscode|0.5.0
Chat Customizations Evaluations|ms-vscode.vscode-chat-customizations-evaluations|ms-vscode|1.0.8
Foundry Toolkit for VS Code|ms-windows-ai-studio.windows-ai-studio|ms-windows-ai-studio|1.6.11
MicroPico|paulober.pico-w-go|paulober|4.3.4
PlatformIO IDE|platformio.platformio-ide|platformio|3.3.4
YAML|redhat.vscode-yaml|redhat|1.24.0
Lua|sumneko.lua|sumneko|3.19.1
Unity|visualstudiotoolsforunity.vstuc|visualstudiotoolsforunity|1.3.1
A/B Experiments
```
vsliv368cf:30146710
vswsl492:30256859
binariesv615:30325510
nativeloc1:31344060
dwcopilot:31170013
dwoutputs:31242946
copilot_t_ci:31333650
e5gg6876:31282496
pythonrdcb7:31342333
6518g693:31463988
aj953862:31281341
82j33506:31327384
envsactivate1:31551504
cloudbuttont:31379625
3efgi100_wstrepl:31403338
ec5jj548:31422691
cp_cls_t_966_ss:31526232
4je02754:31466945
8hhj4413:31478653
cp_cls_c_1081:31454833
conptydll_true:31498968
e9c30283:31461165
46204921:31447328
ei9d7968:31496641
chat:31457767
8hig5102:31480529
89g7j272:31518289
i2gc6536:31499202
52612955:31516516
23c7c724:31520045
ddid_c:31478207
hmra_i5g22:31518061
7df3h592:31512476
cp_cls_t_1082:31535311
logging_enabled_new:31498466
j0d79568:31499440
jb_cp_cls_t_632:31543129
56dj4588:31512888
32d76977:31512328
ha629193:31508444
jh5f2457_c:31540921
jbcp_cls_pctr_t:31531130
cp_intellij_t_nes:31548657
jf4hg949:31526829
ahp-both-windows:31556933
ihg5j128:31534457
9gg7f176:31542112
nes-ex-cf-euporie-03:31542868
enable_editor_pane_layout:31569726
allow-none:31555437
ac562147:31564510
c7c27ce7:31554789
1h923230:31564177
0dg73464:31554319
treatment-23-1:31555779
unuse_dynamic_mcp:31555281
0d8dfbc3:31570291
nemo-v2:31565334
0c1h4866:31566224
session-mark-done:31558131
5b8j3302:31564601
mangle-name-control:31572633
39a5d156:31574986
2bfb8b39:31576696
permission_prompt_treatment:1332566
ccr_pr_nudge_adoption:1319471
vsc_wsm_t:1340632
jidc7660:1370295
auto_mode_treatment:1367907
```
Contributor guide
Assessment
This issue has not been assessed yet.