Skip to content

Copilot model fetch fails when telemetry.devDeviceId starts with UTF-8 BOM #315612

Closed

Description

@Jcardif
  • Copilot Chat Extension Version: 0.48.2026051101 in VS Code Insiders; 0.47.0 in Stable
  • VS Code Version: 1.120.0-insider, commit 05ca786, date 2026-05-11T03:48:51Z. Also observed in Stable 1.119.0.
  • OS Version: macOS 26.4.1 (25E253), arm64
  • Feature (e.g. agent/edit/ask mode): Chat/model picker/model fetch
  • Selected model (e.g. GPT 4.1, Claude 3.7 Sonnet): none; models fail to load
  • Logs:

GitHub Copilot Chat output repeatedly shows:

TypeError: Cannot convert argument to a ByteString because the character at index 0 has a value of 65279 which is greater than 255.
    at webidl.converters.ByteString (node:internal/deps/undici/undici:4005:17)
    at Object.record<ByteString, ByteString> (node:internal/deps/undici/undici:3912:32)
    at webidl.converters.HeadersInit (node:internal/deps/undici/undici:9210:67)
    at Object.RequestInit (node:internal/deps/undici/undici:3968:21)
    at new Request (node:internal/deps/undici/undici:9767:34)
    ...
    at async US._fetchModels (.../extensions/copilot/dist/extension.js:7036:4553): Failed to fetch models

The UI shows Language model unavailable, and the Language Models view shows no Copilot auto mode endpoints.

Root-cause evidence from local VS Code storage:

  • ~/Library/Application Support/Code/User/globalStorage/storage.json contained a UTF-8 BOM (U+FEFF, decimal 65279) at the start of telemetry.devDeviceId.
  • ~/Library/Application Support/Code - Insiders/User/globalStorage/storage.json also contained the same BOM at the start of telemetry.devDeviceId.
  • Removing only that BOM while VS Code was closed fixed model fetching.
  • If VS Code Insiders remains running, it rewrites the bad in-memory value back to disk, causing the issue to recur.
  • Stable stayed clean after the repair, while Insiders reintroduced the BOM in telemetry.devDeviceId after restart/runtime.

No GitHub auth or network change was required; the failure appears to happen before/while constructing fetch headers because the BOM-containing devDeviceId is passed into request metadata/header construction.

Steps to Reproduce:

  1. Have telemetry.devDeviceId in VS Code global storage begin with U+FEFF / UTF-8 BOM.
  2. Start VS Code / VS Code Insiders with GitHub Copilot Chat enabled.
  3. Open Copilot Chat or the Language Models picker.
  4. Observe Language model unavailable and repeated Cannot convert argument to a ByteString... value of 65279 errors while fetching models.

Expected:

Copilot should either sanitize/strip invalid characters from devDeviceId before using it in request headers/metadata, or regenerate the value if it is malformed.

Actual:

Model fetching fails completely until the hidden BOM is manually removed from telemetry.devDeviceId while VS Code is closed.

Related: #314693 reports the same 65279 ByteString failure but does not identify telemetry.devDeviceId as the corrupt value.

Activity

  1. lramos15 commented on May 11, 2026

    @lramos15
    Member
  2. added
    bugIssue identified by VS Code Team member as probable bug
    upstreamIssue identified as 'upstream' component related (exists outside of VS Code)
    telemetryTelemetry system issues
    on May 11, 2026
  3. added this to the 1.121.0 milestone on May 11, 2026
  4. added
    unreleasedPatch has not yet been released in VS Code Insiders
    insiders-releasedPatch has been released in VS Code Insiders
    and removed
    unreleasedPatch has not yet been released in VS Code Insiders
    on May 11, 2026
  5. locked and limited conversation to collaborators on Jun 25, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Labels

bugIssue identified by VS Code Team member as probable buginsiders-releasedPatch has been released in VS Code InsiderstelemetryTelemetry system issuesupstreamIssue identified as 'upstream' component related (exists outside of VS Code)verifiedVerification succeeded

Type

No type

Projects

No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions