agent 窗口缺少自定义模型
- Dominant language
- TypeScript
- Stars
- 193k
- Forks
- 42.4k
- PR merge metrics
- PR metrics pending
Description
Type: Bug
### Does this issue occur when all extensions are disabled?: No
(Requires the GitHub Copilot Chat extension to reproduce; the root cause appears to be in the VS Code core Agent Host BYOK bridge, not in the extension itself.)
### Version & OS Information
- Version of VS Code: 1.129.0 (Intel/x86_64)
- Commit: 125df4672b8a6a34975303c6b0baa124e560a4f7
- Date: 2026-07-15T00:08:44Z
- OS Version: macOS 14.8.2 (x86_64 / Intel)
- Restricted Mode: No
### Steps to Reproduce
1. Configure custom BYOK language models via `chatLanguageModels.json` (e.g. a `customendpoint` provider with Responses / Chat Completions / Messages API types and tool calling enabled).
2. Open the normal VS Code Chat view and confirm the custom models appear in the model picker and can be selected and used.
3. Fully quit VS Code (⌘Q) and all Agents windows, then reopen (a plain `Reload Window` is not enough, per the setting docs).
4. Open the **Agents** window (`Chat: Open Agents Window` / "Open in Agents").
5. Start a new session and select the **Copilot** agent.
6. Open the model picker.
### Actual Behavior
The model picker in the Copilot Agent (Agent Host) only shows **Auto**. None of the custom BYOK models registered in `chatLanguageModels.json` are listed, even though they are fully functional in the normal Chat view.
### Expected Behavior
Custom BYOK models should be selectable in the Copilot Agent model picker, as described by the `chat.agentHost.byokModels.enabled` setting: *"extension-provided BYOK models can run in agent-host sessions."*
### Additional Context / Investigation
- The BYOK models are correctly registered in the renderer. Logs show:
`BYOK: registered 9 provider(s): ollama, anthropic, gemini, xai, openai, openrouter, azure, customoai, customendpoint`
`ConversationFeature: BYOK models available`
(from `.../logs//window/exthost/GitHub.copilot-chat/GitHub Copilot Chat.log`)
- Setting `"chat.agentHost.byokModels.enabled": true` explicitly in `settings.json` and performing a **full restart** does **not** resolve the issue.
- The Agent Host BYOK bridge (`IByokLmBridgeRegistry` / `ByokLmProxyService`) appears to never surface the renderer BYOK models into the Agent Host picker. Relevant source:
- `src/vs/platform/agentHost/common/agentService.ts` (`AgentHostByokModelsEnabledSettingId`)
- `src/vs/platform/agentHost/node/agentHostMain.ts` (gate behind `chat.agentHost.byokModels.enabled`)
- `src/vs/platform/agentHost/electron-browser/localAgentHostService.ts` (bridge only wired when enabled)
- `src/vs/platform/agentHost/node/copilot/copilotAgent.ts` (`onDidChangeModels` republishes models; stays a no-op / empty list when the bridge is not wired)
- No `BYOK bridge` / `Wired N BYOK models` lines appear in the Agent Host logs, indicating the bridge is never established.
- The account has no server-side models with `model_picker_enabled=true`, so when the BYOK bridge is empty the picker collapses to only `Auto`.
- This is a regression compared with earlier VS Code versions where the Agents / Chat agent window allowed selecting custom/local models configured via BYOK.
### Settings
```json
"chat.agentHost.byokModels.enabled": true,
"chat.byokUtilityModelDefault": "mainAgent"
VS Code version: Code 1.129.0 (125df4672b8a6a34975303c6b0baa124e560a4f7, 2026-07-15T00:08:44Z)
OS version: Darwin x64 23.6.0
Modes:
System Info
|Item|Value|
|---|---|
|CPUs|Intel(R) Core(TM) i5-8257U CPU @ 1.40GHz (8 x 1400)|
|GPU Status|2d_canvas: enabled
GPU0: VENDOR= 0x8086 [Google Inc. (Intel)], DEVICE=0x3ea6 [ANGLE (Intel, ANGLE Metal Renderer: Intel(R) Iris(TM) Plus Graphics 645, Version 14.8.2 (Build 23J126))], DRIVER_VENDOR=Intel, DRIVER_VERSION=14.8.2 *ACTIVE*
Machine model name: MacBookPro
Machine model version: 16.3
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: enabled_on
trees_in_viz: disabled_off
video_decode: enabled
video_encode: enabled
webgl: enabled
webgpu: enabled
webnn: disabled_off|
|Load (avg)|5, 16, 14|
|Memory (System)|16.00GB (0.02GB free)|
|Process Argv|--crash-reporter-id 408688fc-073c-4f89-9fff-1daa7440dac3|
|Screen Reader|no|
|VM|0%|
Extensions (21)
Name|Identifier|Author|Version
---|---|---|---
Continue - open-source AI code agent|continue.continue|Continue|2.0.0
Database Client JDBC|cweijan.dbclient-jdbc|cweijan|1.4.6
Database Client|cweijan.vscode-database-client2|cweijan|9.0.2
Code Runner|formulahendry.code-runner|formulahendry|0.12.2
Go|golang.go|golang|0.56.0
Rainbow CSV|mechatroner.rainbow-csv|mechatroner|3.24.1
MongoDB for VS Code|mongodb.mongodb-vscode|mongodb|1.16.1
Azure Resources|ms-azuretools.vscode-azureresourcegroups|ms-azuretools|0.12.7
Chinese (Simplified) (简体中文) Language Pack for Visual Studio Code|ms-ceintl.vscode-language-pack-zh-hans|MS-CEINTL|1.129.2026071318
.NET Install Tool|ms-dotnettools.vscode-dotnet-runtime|ms-dotnettools|3.1.0
Data Workspace|ms-mssql.data-workspace-vscode|ms-mssql|0.6.3
SQL Server (mssql)|ms-mssql.mssql|ms-mssql|1.44.0
SQL Bindings|ms-mssql.sql-bindings-vscode|ms-mssql|0.4.1
SQL Database Projects|ms-mssql.sql-database-projects-vscode|ms-mssql|1.6.2
Playwright Test for VSCode|ms-playwright.playwright|ms-playwright|1.1.19
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.2.1
Python Environments|ms-python.vscode-python-envs|ms-python|1.36.0
Jupyter|ms-toolsai.jupyter|ms-toolsai|2025.9.1
Vue (Official)|vue.volar|Vue|3.3.7
A/B Experiments
```
vsliv368:30146709
binariesv615:30325510
nativeloc1:31344060
dwcopilot:31170013
dwoutputs:31242946
copilot_t_ci:31333650
e5gg6876:31282496
pythonrdcb7:31342333
6518g693:31463988
aj953862:31281341
6abeh943:31336334
envsactivate1:31551504
cloudbuttont:31379625
3efgi100_wstrepl:31403338
bj468946:31457056
ec5jj548:31422691
cp_cls_t_966_ss:31526232
8hhj4413:31478653
38bie571_auto:31426784
cp_cls_c_1081:31454833
conptydll_true:31498968
e9c30283:31461165
test_treatment2:31471001
c9b86496:31447327
capico_bxe_098a3278:31551525
idci7584:31464702
e3e4d672:31494082
ei9d7968:31496641
chat:31457767
8hig5102:31480529
89g7j272:31518289
7e187181:31503455
i2gc6536:31499202
52612955:31516516
ghj88844:31499326
23c7c724:31520045
ddid_t:31478206
hmra_i5g22:31518061
ie3bb177:31543534
7df3h592:31512476
cp_cls_t_1082:31535311
logging_enabled_new:31498466
j0d79568:31499440
jb_cp_cls_t_632:31543129
852d2892:31506239
56dj4588:31512888
32d76977:31512328
ha629193:31508444
cdk-lw-on:31524445
f9bf7985:31543584
a1ije391_t:31540920
8hfba999:31537718
jbcp_cls_pctr_t:31531130
61138546:31518536
cp_intellij_t_nes:31548657
jf4hg949:31526829
nes-curr-leftover-1500:31538366
h561g132:31533256
session_8:31532895
ihg5j128:31534457
f412h606:31551416
9gg7f176:31542112
sandbox-ui-on-2:31543161
nes-ex-cf-euporie-03:31542868
7642ad28:31552287
6i51c363:31551401
```
Contributor guide
Assessment
This issue has not been assessed yet.