Repository navigation
Description
Summary
thv llm setup --client vscode (and vscode-insider) reports success and patches settings.json with:
"github.copilot.advanced.serverUrl": "http://localhost:14000/v1",
"github.copilot.advanced.apiKey": "thv-proxy"(pkg/client/config.go:436-439 for VS Code Insiders, :479-482 for VS Code, via ConfigureLLMGateway in pkg/client/llm_gateway.go). The gateway proxy starts and responds correctly, but the VS Code UI reports "unknown configuration setting" for both keys, and Copilot Chat continues to use its normal model list — nothing routes through the gateway.
Root cause
github.copilot.advanced.* is not a setting the Copilot Chat extension registers or reads. It appears to be a holdover from an earlier, single-model version of Copilot; there's no reference to it anywhere in the current microsoft/vscode-copilot-chat source.
The current mechanisms for pointing Copilot Chat at a custom OpenAI-compatible endpoint are different, and there appear to be two of them depending on VS Code/Copilot version:
github.copilot.chat.customOAIModels— a Copilot Chat extension setting insettings.json, a map of model-id →{name, url, toolCalling, vision, maxInputTokens, maxOutputTokens, requiresAPIKey, ...}(src/platform/configuration/common/configurationService.tsinvscode-copilot-chat).chatLanguageModels.json— a separate file in the sameUserfolder assettings.json/mcp.json, written by VS Code core's own "Manage Models" UI rather than the Copilot extension. Core VS Code hardcodes acustomendpointBYOK vendor (src/vs/workbench/contrib/chat/common/languageModels.ts) whose schema (extensions/copilot/package.json) requires an explicitmodels[]array — each model needsid,name,url,toolCalling,vision,maxOutputTokens— with no/modelsdiscovery. TheapiKeyfield is marked"secret": true, and the UI stores it as an${input:chat.lm.secret.<hash>}reference resolved from VS Code's encrypted secret storage rather than a literal string, though it's unconfirmed whether a literal string also works when written directly.
Why this needs care, not just a key-name fix
Unlike a simple rename, the replacement isn't a single JSON pointer swap:
- Every model the gateway can serve would need to be explicitly enumerated in
models[]— there's no discovery endpoint in this schema, similar to the--modelsflag already needed for Claude Desktop. - The
apiKeyfield's secret-reference convention needs to be validated before assuming a plain string works forthv llm setup's non-interactive flow. - Two candidate mechanisms exist depending on VS Code/Copilot version; worth confirming which (or both) should be targeted, and whether older VS Code versions need the
customOAIModelspath as a fallback.
Impact
Every thv llm setup --client vscode / vscode-insider run to date has silently failed to configure Copilot Chat, while reporting success.
References
pkg/client/config.go:436-439(VS Code Insiders),:479-482(VS Code)pkg/client/llm_gateway.go:39-60(ConfigureLLMGateway, JSON-Pointer patch path)- Related: Cursor LLM gateway config is a no-op: writes settings Cursor never reads #6293 (same root-cause pattern for Cursor)
Activity
Update VS Code LLM integration
Update VS Code LLM integration
Update VS Code LLM integration
Update VS Code LLM integration
Update VS Code LLM integration
Update VS Code LLM integration
Update VS Code LLM integration (stacklok#6492)