Files
vscode/extensions/copilot/src/lib
b8f0253990 Include editor headers in proxy models request (#324928)
Include editor headers in proxy models request; thread real editor info through chat-lib NES path

The proxy models service fetched `/models` with only an Authorization
header, bypassing the CAPIClient path that normally injects
Editor-Version / Editor-Plugin-Version. Chat-lib's NES provider also
resolved IEnvService to NullEnvService, so it would have emitted
placeholder (test) editor headers even after the fix.

- Refactor getEditorVersionHeaders() from an AbstractEnvService method
  into an exported free function taking any IEnvService, so it works for
  every environment (VS Code, chat-lib/CLI, tests), including impls that
  don't extend AbstractEnvService.
- Inject IEnvService into ProxyModelsService and add the editor headers
  to the /models fetch.
- Add required editorInfo / editorPluginInfo to INESProviderOptions and
  register a real IEnvService in the NES service builder, mirroring the
  completions path. Making them mandatory turns a missing value into a
  compile error instead of silently shipping test headers.
- Add unit tests covering the proxy models fetch headers and the
  end-to-end NES /models request headers.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
2026-07-08 13:36:41 +00:00
..