Copilot Harness: BYOK custom-endpoint model not selectable for Remote Scenarios (WSL, Dev Containers, SSH etc)
Issue Type: Bug Report
VS Code version: 1.134.0 (user setup) Copilot: 1.0.81-0 OS: Windows 11, WSL2 (Remote-WSL, Ubuntu)
Summary
A Bring-Your-Own-Key (BYOK) model configured via the Custom Endpoint provider appears in the Agents window model picker for local Windows workspaces, but is missing for WSL workspaces, even with the required experimental flag enabled.
Settings (User scope, global settings.json)
"chat.agentHost.enabled": true,
"chat.agentHost.byokModels.enabled": true
Model config (chatLanguageModels.json, Custom Endpoint, Chat Completions)
[
{
"name": "DeepSeek",
"vendor": "customendpoint",
"apiKey": "<redacted>",
"apiType": "chat-completions",
"models": [
{
"id": "deepseek-v4-pro",
"name": "DeepSeek V4 Pro",
"url": "https://api.deepseek.com/chat/completions",
"toolCalling": true,
"vision": false,
"thinking": true,
"contextWindow": 1000000,
"maxOutputTokens": 384000
}
]
}
]
Steps to reproduce
- Add the BYOK Custom Endpoint model above via
Chat: Manage Language Models. - Enable
chat.agentHost.enabledandchat.agentHost.byokModels.enabledin User settings. - Fully restart VS Code (all windows closed).
- Open a WSL folder, open the Agents window, start a session with the Copilot harness.
- Open the model picker.
Expected
The DeepSeek V4 Pro model is listed and selectable.
Actual
The model is absent from the picker. It does appear in the Language Models editor (Manage Language Models), and it does appear in the Agents window picker when the session workspace is a local Windows folder instead of WSL.
Additional context
- The same model works fine in the regular Chat view in WSL (selectable and functional, including agent/tool use).
- The gap is specific to the Agents window + WSL workspace combination for BYOK custom-endpoint models.
- The model has
toolCalling: true, so it isn't being filtered out for lack of tool support.
@vritant24 This looks closely related to #329815.
I originally reported a related BYOK + Windows/WSL2 case there. #329815 was closed after it “seemed to be solved for most”, but after comparing the exact 1.132 commit from that issue (df53daabb18cd157bdb08c7f01c34df936cf12f4) with current main, I don't think the underlying WSL / Agent Host gap was actually resolved.
A few relevant findings:
-
In 1.132,
chat.agentHost.byokModels.enabledwas a startup-time gate, defaulting tofalse. -
The value was forwarded into the Agent Host process through
VSCODE_AGENT_HOST_BYOK_MODELS_ENABLED. -
When disabled, the renderer BYOK connection was not wired, leaving
ByokLmBridgeRegistryempty. That directly explains logs such as:modelTarget="agent-host-copilotcli" availableModels="agent-host-copilotcli:auto"In that state, the failure occurs before any request reaches the custom endpoint — the Agent Host catalog simply never receives the BYOK model.
Current main has improved this substantially:
- the BYOK setting is synchronized into the running Agent Host and no longer requires restart;
CopilotAgentreacts to config changes and republishes BYOK models;- the renderer bridge now also reacts to model visibility / BYOK enablement changes.
However, current source still explicitly distinguishes two Agent Host topologies:
{ kind: 'renderer'; bridgeRegistry: IByokLmBridgeRegistry }
| { kind: 'unavailable' }
The local utility-process Agent Host uses:
byok: { kind: 'renderer', bridgeRegistry: byokLmBridgeRegistry }
while the standalone Agent Host path uses:
byok: { kind: 'unavailable' }
That seems very relevant to #332085, where the behavior is:
- Windows local workspace: BYOK model works in Agents
- Remote-WSL workspace: same BYOK model disappears from the Agents picker
- regular Chat inside WSL: BYOK still works
This is also consistent with your earlier comment in #329815 that BYOK models were unsupported when using a remote Agent Host inside WSL.
So the key question seems to be:
Is a Remote-WSL Agents session currently expected to use an Agent Host path where BYOK is intentionally unavailable?
If yes, then #332085 looks more like the still-unimplemented Remote Agent Host BYOK path than a custom-endpoint configuration issue.
If Remote-WSL Agents are expected to support renderer-provided BYOK now, then the renderer vs unavailable runtime split seems like a good place to investigate.
I think #329815 is useful context here because its Windows/local workaround did not cover the WSL Agent Host case, and #332085 appears to reproduce that remaining gap.
Hello, thanks for filing the issue and providing more details around it. Looking into it, a remote path is used to communicate with the agent host in WSL scenarios, and so currently that is not supported. Since this issue is more specific to WSL, I am tracking that here. I will reference that in a comment in there. Support for WSL is added to the backlog
I want to add another data point for visibility: in my case this is no longer limited to the Agents window.
Over roughly the last two weeks, this appears to have regressed in the regular Chat UI as well when the workspace is opened through Remote-WSL. My BYOK custom endpoint models work as expected in normal Windows/local workspaces, but in WSL the model picker in the standard chat view/editor chat no longer behaves correctly: the BYOK models may disappear from selection, or the chat ends up routing to Copilot-hosted models instead.
So from my side, this looks broader than an Agents-window-only problem and seems to affect regular Chat sessions in WSL too.
The important variable is specifically Remote-WSL: same VS Code installation, same account, same BYOK configuration, different behavior only when the workspace is opened in WSL.
I am having exact same issue also. I use the chat window from wsl and model picker is not working. Upgraded yesterday and now I have to downgrade.
Yea, they are about to lose my $100+ a month subscription. Tired of this horsesh*t. I'm actively searching for a replacement for my dev environment as I type this.
Thanks for all the feedback.
We are still looking into supporting WSL and other remote scenarios for BYOK with the new copilot harness.
If you are currently blocked, select the Local harness and you should see your BYOK models show up again and work
Thanks for all the feedback. We are still looking into supporting WSL and other remote scenarios for BYOK with the new copilot harness. If you are currently blocked, select the
Localharness and you should see your BYOK models show up again and work![]()
this works! thanks
My workspace is on a remote Linux host (SSH to Plesk), BYOK/custom-endpoint models don't flow into the remote Agent Host. In the SSH window the model picker will only offer Auto only. And I'm in IDE mode.
select the
Localharness
That doesn't work. The discussion was originally about the Agents window and connections to WSL.
To work around this, I spent hours moving my development environment back to windows only to open VSCode this morning to find that I am getting this error in a chat that was working when I closed vscode. This is a chat on the windows side. NOT WSL.
Error: (modelSelectionFailed) Request session.model.switchTo failed with message: Provider model 'deepseek/deepseek-flash' is not registered
However, I open vscode agent window locally and it does work but the chat window to the same model will not work. Even on the windows side.
For the record for those reading this. If you open the editor and connect to WSL, then open an agent window session and select "local" as is suggested in an earlier reply. It will indeed enable your byok models but you will be running "locally" in windows. The agent session will be able to call into wsl but its incredibly resource heavy, or was last time I tried it.
Add to this the recent windows update that reset nearly all of my windows developer settings and this is turning into a really painful rollout for the vscode community.
It appears that changes to the underlying harness SDK is switching feature usability out from under developers with zero notice. Why else would a chat work on the WSL side when I closed the editor yesterday and fail to the same model today when I opened the editor? I may be completely wrong about that though.
The issue is that the vscode team has decided to force everyone onto the agent harness whatever you wanna call it experience. Ok, I'm fine with that as long as you FIX what you are forcing me onto before you break what I am currently using. If you can't be bothered to do that then I will find another provider that will.
22.
> select the
LocalharnessThat doesn't work. The discussion was originally about the Agents window and connections to WSL.
Yes sorry, I've now used to track all Copilot Harness related issues with BYOK for Remote Scenarios (WSL, Dev Containers, SSH etc) as they all follow a similar line of support as far as code goes
23. To work around this, I spent hours moving my development environment back to windows only to open VSCode this morning to find that I am getting this error in a chat that was working when I closed vscode. This is a chat on the windows side. NOT WSL. Error: (modelSelectionFailed) Request session.model.switchTo failed with message: Provider model 'deepseek/deepseek-flash' is not registered However, I open vscode agent window locally and it does work but the chat window to the same model will not work. Even on the windows side. For the record for those reading this. If you open the editor and connect to WSL, then open an agent window session and select "local" as is suggested in an earlier reply. It will indeed enable your byok models but you will be running "locally" in windows. The agent session will be able to call into wsl but its incredibly resource heavy, or was last time I tried it. Add to this the recent windows update that reset nearly all of my windows developer settings and this is turning into a really painful rollout for the vscode community. It appears that changes to the underlying harness SDK is switching feature usability out from under developers with zero notice. Why else would a chat work on the WSL side when I closed the editor yesterday and fail to the same model today when I opened the editor? I may be completely wrong about that though. The issue is that the vscode team has decided to force everyone onto the agent harness whatever you wanna call it experience. Ok, I'm fine with that as long as you FIX what you are forcing me onto before you break what I am currently using. If you can't be bothered to do that then I will find another provider that will.
@tyrsson Sorry about this, and thanks for the detailed write-up.
There are two separate problems here:
-
Remote workspaces (WSL / SSH / Dev Containers) with the Copilot harness. This is still a known gap, and this issue is tracking it. When the workspace is remote, the agent host runs on the remote side, and BYOK models don't reach it yet.
-
A Windows-local chat failing with Provider model 'deepseek/deepseek-flash' is not registered. This one is a different bug, since nothing in it is remote. From your description, the chat was created yesterday and restored today. A restored session can start before VS Code has finished registering your BYOK models with it, and then switching to the model fails. We've recently made changes so the BYOK models get registered on restored sessions before the model switch. This fix is in Insiders, and will be in Stable with 1.141
We are still working on adding support for BYOK model across all harnesses and scenarios to maintain continuity.
Works for me too thanks. And the new harniess still needs more work anyway. But will check if there are other issues to report.
Just click on the magic button...
To have it working as before you need to select the "Local" mode.
26. To have it working as before you need to select the "Local" mode.
This is not really a solution I think: the "local" and "copilot" harnesses are two different things that behave differently, correct? People here (including me) are trying to get ollama working in the copilot harness explicitly.
@jaspervandorp As far as I'm concerned, the original issue is about using local models in the Agents window within a WSL workspace, not in the regular chat.
Already run into the same issue, and it's pretty annoying tho. Remote development and the usual chat fully support BYOK and work fine (with the Local harness, btw, the Copilot harness is a different story). But as soon as you open the Agents window and WSL Workspace, the "Local" option is just gone, and you're stuck with only Copilot. Still not fixed ((
28. jaspervandorp As far as I'm concerned, the original issue is about using local models in the Agents window within a WSL workspace, not in the regular chat. Already run into the same issue, and it's pretty annoying tho. Remote development and the usual chat fully support BYOK and work fine (with the Local harness, btw, the Copilot harness is a different story). But as soon as you open the Agents window and WSL Workspace, the "Local" option is just gone, and you're stuck with only Copilot. Still not fixed ((
I start to have this alert today when starting a WSL session, Bring your own key (BYOK) models aren't supported in remote Copilot sessions. It's too bad, it works in last version.
Any version planned with this fix? Because now copilot harness is the default harness, so it's weird if the default harness doesn't support byok!
@vritant24 Is there an ETA for this feature to support BYOK for remote sessions? Can we get someone to help on this?
> select the