Repository navigation
Description
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": trueModel 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.
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
Activity
nicezic commentedon Sep 6, 2026
Vritant Bhardwaj (@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 currentmain, 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:In that state, the failure occurs before any request reaches the custom endpoint — the Agent Host catalog simply never receives the BYOK model.
Current
mainhas improved this substantially:CopilotAgentreacts to config changes and republishes BYOK models;However, current source still explicitly distinguishes two Agent Host topologies:
The local utility-process Agent Host uses:
while the standalone Agent Host path uses:
That seems very relevant to #332085, where the behavior is:
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
renderervsunavailableruntime 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.
vritant24 commentedon Sep 7, 2026
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
docs(readme): document known Remote-WSL Agents window BYOK limitation
PowerfulPony commentedon Sep 27, 2026
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.
hamdano2 commentedon Oct 4, 2026
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.
44 remaining items
Add BYOK model bridge for remote Agent Host
Fix BYOK bridge review findings : gate, DI, registry, registration
Naz-Ovh commentedon Nov 7, 2026
it is used to be working. now it is gone. what the mf changes.
jeancz commentedon Nov 9, 2026
I ran into this on a newer build (VS Code 1.145.2, commit c4453f8, Copilot Chat extension 0.73.0, Remote-WSL to Debian / WSL 2.7.13.0) and filed #346513, which got closed as a duplicate of this one — reproduction and symptoms match exactly (local workspace: BYOK models work in the Agents window Copilot harness; WSL workspace: same models vanish from that picker but keep working fine in the classic Chat view). Adding what I found while digging into logs, since it narrows down where the break actually happens and rules out a couple of plausible causes:
Root-cause signal found in the logs: on a local Windows workspace, the per-window Agent Host log (
agenthost.log) contains an explicit bridging step for a brand new Copilot harness session:On the Remote-WSL side, the equivalent remote Agent Host log (
~/.vscode-server/data/logs/<ts>/agenthost.log) for an otherwise identical Copilot harness session never contains this line, or any error/warning mentioning BYOK, the loopback proxy, or the custom endpoint provider. It just logs the native Copilot catalog and stops:So the bridging step that wires BYOK providers into the Copilot SDK session simply never runs for the remote Agent Host — silently, with nothing logged to indicate it was skipped or failed.
Ruled out as causes (tested explicitly):
Logged in as <user>,Got Copilot token for <user>,[Copilot] Auth token updated) — the native model list populates correctly afterward (Found 18 models...), but BYOK is still never wired. An earlier, unauthenticated attempt did surface a distinctsession.model.list failed with message: Not authenticatederror, which is a separate/unrelated failure mode from the silent BYOK-skip described above.GitHub Copilot Chat.logshows thecustomendpointprovider registering and fetching its model catalog successfully (BYOK: registered 9 provider(s): ...,ConversationFeature: BYOK models available) — so the provider/catalog is healthy on the remote side; it's specifically the Agent Host → Copilot SDK bridging step that's missing.curlfrom inside the same WSL distro to the custom endpoint's hostname succeeds (TLS handshake + HTTP response) using the same DNS path the extension host would use, so this isn't a connectivity/DNS issue to the backend.Working theory, based on the above: the "loopback proxy" (
http://127.0.0.1:<port>/v/customendpoint) used to bridge BYOK providers into the Copilot SDK session is set up on/reachable from the local (Windows) side only. The Agent Host process for a Remote-WSL session runs inside WSL's own network namespace and either never attempts to reach that loopback proxy or can't — and that failure (or skip) isn't surfaced as an error anywhere, which is presumably why it's been hard to pin down.Settings that had no effect on this specific symptom, for anyone else chasing it:
chat.agentHost.byokModels.enabled,chat.defaultToCopilotHarness,chat.editor.localAgent.enabled,chat.temporaryDefaultToLocalHarness.Naz-Ovh commentedon Nov 9, 2026
A bunch of AI comments. LOL.
alexplex commentedon Nov 11, 2026
Now that the Local harness is deprecated and will be retired in February as per the changelog of 1.146, I hope that the Copilot harness will support BYOK models for remote sessions before that.
cvsickle commentedon Nov 11, 2026
I hope the same. I'm in a situation where we MUST sandbox our agents in dev containers and we MUST proxy our models though LiteLLM. I can't believe this set of requirements is all that unique. Removing the Local harness without allowing BYOK models in dev containers would essentially render the Copilot chat useless for us.
vritant24 commentedon Nov 11, 2026
Hi, just a small update, we are still working on supporting BYOK for remote scenarios in the Copilot Harness and it is a priority. We intend to have that support before we remove the local harness
bn45hkurr0y4 commentedon Nov 11, 2026
Vritant Bhardwaj (@vritant24)
Regarding Copilot Harness: will you open-source all of its related components in the future—for instance, the runtime itself? Or will it always be distributed in binary form, including within VSCodium/Code OSS?
I’m referring, at the very least, to this:
~\appdata\local\programs\microsoft vs code\69047191fc\resources\app\node_modules.asar.unpacked\@github\copilot-sdk-win32-x64\prebuilds\win32-x64\copilot-runtime.exethoth291 commentedon Nov 16, 2026
Related, narrower question: this issue and #346352 focus on the built-in Custom Endpoint provider. I filed #348630 about models contributed by extensions through
vscode.lm.registerLanguageModelChatProvider. On 1.146.0 such a model works in a local Copilot session, but in a remote window the Copilot harness never offers it, and the provider is never called. These providers can't always become agent-host plugins (#340335) because they may depend on the client's credentials or network. #348630 has a minimal repro extension, an automated test, source references and proposals.Could you confirm here whether extension-contributed providers are in scope for remote Copilot sessions before the Local harness is removed?
feat: run LunaRoute in the remote host for SSH windows (#5)
de0xyrib0se commentedon Nov 22, 2026
Unless this is fixed removing the local harness will leave a lot of folks with no choice on using VSC. A solution is definitely needed ASAP.
Add BYOK model bridge for remote Agent Host
Fix BYOK bridge review findings : gate, DI, registry, registration
NicolasWeb commentedon Nov 24, 2026
Vritant Bhardwaj (@vritant24) Ashutosh (@ashutosh-maheshwari) — Update on #346352 (the BYOK bridge for a remote Agent Host) — I left a pointer here on 2026-11-05; the state has moved since, and given the February Local-harness removal mentioned above it seems worth recording where the contribution stands.
mainand adapted to the BYOK streaming contract that landed upstream since the PR was opened: renderer deltas now flow over avscode/byokLmDeltanotification into the bridge connection'sonDidDelta.clientId#seq), so a reconnect can no longer evict a peer's model registration — with a regression test for exactly that.619d97a: compilePASS; node lanePASS(564 passing onprotocolServerHandler.test.ts, including the bridge and delta cases); the client-side suites re-ran at the same head withPASS; lint re-run as CI invokes it —oxlint --changed-sincePASSandhygiene --changed-sincePASSon all changed files.Scope note for the thread above about extension-contributed providers (#348630): this PR bridges the built-in Custom Endpoint / BYOK language models only; extension-registered providers remain a separate concern.
I still owe the live Remote-WSL check against a real BYOK endpoint and will post the result here when it has been run. Until an official build lands, anyone willing to try the bridge can build the PR branch and follow the "How to test?" steps there.