You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Support variable interpolation in chatLanguageModels.json requestHeaders #329469
Support variable (template) interpolation in requestHeaders values of chatLanguageModels.json, so values can be dynamic per workspace — e.g. include the current repo/folder name in a custom header without editing the file per repo.
Motivation / Use case
With the Custom Endpoint (vendor: customendpoint) provider, I configure a gateway (LiteLLM) and want to tag every request with the repository it originates from:
I want x-litellm-tags to resolve to the current repo name per workspace.
Current behavior
requestHeaders values are sent verbatim. I traced the path:
languageModelsConfigurationService.ts parses the JSON with a JSONVisitor — values taken literally.
languageModels.ts_resolveConfiguration() only resolves ${input:...} for properties marked secret: true in the schema (e.g. apiKey).
customEndpointProvider.ts copies requestHeaders verbatim into model info.
openAIEndpoint.ts_sanitizeCustomHeaders() filters names but does not interpolate values.
Only ${apiKey} is specially replaced (_interpolateApiKey).
So ${workspaceFolder}, ${workspaceFolderBasename}, ${env:FOO}, ${userHome} etc. are sent as literal strings.
Proposed change
Apply the same variable substitution already used by other config surfaces (tasks.json/launch.json via IConfigurationResolverService) to requestHeaders values — or at minimum support ${workspaceFolder}, ${workspaceFolderBasename}, ${userHome}, and ${env:VAR}.
At minimum a subset could be resolved: identical tokens to ${apiKey} but scoped to workspace/user/env.
Notes
macOS + VS Code 1.x, Dev Container remote extension host in use.
This is the chatLanguageModels.json BYOK custom-endpoint schema (requestHeaders), not the deprecated chat.customOAIModels setting.
Activity
copilot: add language model request middleware API