Skip to content

Copilot Chat fails on macOS arm64 with Electron fetcher: “Cannot convert argument to a ByteString … char 65279 (U+FEFF)” (regression between 1.110.1 and 1.115.0) #308639

@EsWees

Description

@EsWees

Summary

On macOS arm64, GitHub Copilot Chat crashes/fails to fetch models/sessions with:

TypeError: Cannot convert argument to a ByteString because the character at index 0 has a value of 65279 which is greater than 255.

This occurs when VS Code uses the Electron fetcher (log shows: “Using the Electron fetcher.”). Downgrading VS Code to 1.110.1 resolves the problem with the same Copilot Chat extension version, indicating a regression in newer VS Code/Electron/undici/WebIDL header handling.

Environment (WORKING)

  • VS Code: 1.110.1
    • Commit: 61b3d0a
    • Date: 2026-03-06T23:03:27.520Z
  • Electron: 39.6.0
  • Chromium: 142.0.7444.265
  • Node.js: 22.22.0
  • V8: 14.2.231.22-electron.0
  • OS: Darwin arm64 25.3.0
  • Extension: GitHub Copilot Chat 0.38.2

Result: Copilot Chat works.

Environment (FAILING)

  • VS Code: 1.115.0 (from Copilot Chat logs before downgrade)
  • OS: macOS arm64
  • Extension: GitHub Copilot Chat 0.43.0

Result: Copilot Chat fails with ByteString error repeatedly when fetching sessions/models.

Steps to Reproduce

  1. On macOS arm64, install VS Code 1.115.0.
  2. Install GitHub Copilot + GitHub Copilot Chat (tested with Copilot Chat 0.43.0).
  3. Sign in to GitHub/Copilot.
  4. Open Copilot Chat or let it activate (it attempts to fetch models/sessions).

Actual Behavior

Copilot Chat fails to fetch sessions/models. Output log repeatedly contains:

  • “Using the Electron fetcher.”
  • Then crash while constructing a Request / headers via Electron fetch (undici WebIDL converters)

Example stack (trimmed):

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 fetchWithSession (node:electron/js2c/utility_init:2:358)
...

The error suggests a request header value begins with U+FEFF (BOM) and Electron/undici rejects it as ByteString.

Expected Behavior

Copilot Chat should not crash/fail due to a non-ASCII/ByteString character in headers; VS Code/Electron fetch should either:

  • sanitize/reject with a clearer error that identifies the offending header, and/or
  • be consistent with previous versions where Copilot Chat worked.

Notes / Diagnostics

  • No proxy variables were set in the environment (http_proxy, https_proxy, etc. empty).
  • VS Code settings.json does not contain BOM.
  • git config --global -l showed no UTF-8 BOM bytes (checked via xxd).
  • Downgrading VS Code to 1.110.1 makes Copilot Chat work again without other changes.

Request

Please investigate regression in VS Code 1.115.0 around Electron fetch / undici headers / WebIDL ByteString conversion that breaks Copilot Chat network requests on macOS arm64.

Metadata

Metadata

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions