Skip to content

VS Code LLM gateway config uses Copilot keys the extension no longer reads #6294

Closed

Description

@danbarr

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:

  1. github.copilot.chat.customOAIModels — a Copilot Chat extension setting in settings.json, a map of model-id → {name, url, toolCalling, vision, maxInputTokens, maxOutputTokens, requiresAPIKey, ...} (src/platform/configuration/common/configurationService.ts in vscode-copilot-chat).
  2. chatLanguageModels.json — a separate file in the same User folder as settings.json/mcp.json, written by VS Code core's own "Manage Models" UI rather than the Copilot extension. Core VS Code hardcodes a customendpoint BYOK vendor (src/vs/workbench/contrib/chat/common/languageModels.ts) whose schema (extensions/copilot/package.json) requires an explicit models[] array — each model needs id, name, url, toolCalling, vision, maxOutputTokens — with no /models discovery. The apiKey field 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 --models flag already needed for Claude Desktop.
  • The apiKey field's secret-reference convention needs to be validated before assuming a plain string works for thv 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 customOAIModels path 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

Activity

  1. added
    needs-triage
    on Aug 12, 2026
  2. self-assigned this
    on Sep 2, 2026
  3. added
    bug
    p2
    and removed
    needs-triage
    on Sep 2, 2026
  4. added 6 commits that reference this issue on Sep 3, 2026
    479bf3c
    2209cf4
    c6cd1e8
    c2a7c51
    5903868
    a6d771b
  5. added a commit that references this issue on Sep 3, 2026
    166a226
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

bugp2

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions