microsoft / microsoft/vscode

Copilot: update nested ts-http-runtime dependency to avoid navigator migration diagnostics

Open
#336,853 0 comments 0 reactions 1 assignee View on GitHub

@roblourens is already working on this.

Since Sep 18, 2026.

Dominant language
TypeScript
Stars
193k
Forks
42.8k
PR merge metrics
PR metrics pending

Description

Summary

Copilot still locks a nested @typespec/ts-http-runtime@0.3.2 under @azure/core-util@1.13.1. That runtime reads navigator at module initialization when checking for React Native, even in a Node extension host.

The upstream SDK has already replaced this runtime sniffing with platform-specific environment modules. This issue tracks adopting that fix in Copilot's dependency graph, not a new upstream implementation or a claim that this diagnostic causes extension-host crashes.

Current evidence

At VS Code main commit ee8bba4d5789f10215e2f39e0f464caa924cdf31:

  • The parent dependency is @azure/core-util@1.13.1, which permits @typespec/ts-http-runtime through ^0.3.0.

  • Its nested locked copy is still 0.3.2.

  • The current Copilot bundle's source map includes this copy's util/checkEnvironment module. Its module-level check is:

    typeof navigator !== "undefined" && navigator?.product === "ReactNative"
    
  • A fresh-process probe of the installed dependency read a counting navigator getter once while importing @azure/core-util. The import completed successfully.

Minimal reproduction

Run from a VS Code checkout with the current Copilot dependencies installed:

node --input-type=module <<'NODE'
import { createRequire } from 'node:module';
import { resolve } from 'node:path';

const copilotRequire = createRequire(resolve('extensions/copilot/package.json'));
let navigatorReads = 0;
Object.defineProperty(globalThis, 'navigator', {
  configurable: true,
  get() {
    navigatorReads++;
    return undefined;
  }
});

copilotRequire('@azure/core-util');
console.log({ navigatorReads }); // Currently: { navigatorReads: 1 }
NODE

This reproduces the accessor read independently of the extension host; it does not reproduce or assert a crash.

Existing upstream fix

Azure/azure-sdk-for-js#37974, merged April 13, 2026, removed checkEnvironment.ts and introduced platform-specific environment modules. I also checked the published @typespec/ts-http-runtime@0.3.9 package: its Node env.js sets isReactNative to false without reading navigator.

Requested change / validation

  • Update the relevant dependency resolution and lockfile so this nested copy consumes a released fixed implementation. Check runtime requirements when selecting the version (0.3.9 requires Node >=22).
  • Verify the Node bundle resolves the appropriate environment implementation and the focused import probe no longer touches navigator through this dependency path.
  • Verify Copilot activation and the affected Azure-client functionality still work; preserve browser / other supported build behavior.
  • Do not work around this by changing extensions.supportNodeGlobalNavigator or patching the global.

Other dependencies can still access navigator; this issue is intentionally scoped to the confirmed Azure runtime path.

Related reports

  • Investigation context: #334504. Its reported authentication failures / extension-host crashes need separate diagnostic evidence. The migration diagnostic alone does not establish their cause.
  • The separate 1DS telemetry dependency path is already tracked in microsoft/vscode-extension-telemetry#229.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.