Skip to content
This repository was archived by the owner on Jun 5, 2026. It is now read-only.
This repository was archived by the owner on Jun 5, 2026. It is now read-only.

Microsoft Foundry for Visual Studio Code modified the global fetch function, causing fetch requests from other extensions to fail, error message: 'RequestInit: duplex option is required when sending a body' #605

@tunefun

Description

@tunefun

Expected Behavior

Does not affect the fetch calls of other plugins

Actual Behavior

Affects the fetch calls of other plugins

Steps to Reproduce the Problem

  1. Install the Microsoft Foundry for Visual Studio Code plugin in VSCode

  2. Develop another extension with the following code:

import * as vscode from 'vscode';

export async function activate(context: vscode.ExtensionContext) {
    let originFetch = fetch
    console.log("origin fetch: ", fetch)

	console.log("\n--------------------")
    await new Promise(resolve => setTimeout(resolve, 10000))
	console.log("--------------------\n")

    console.log("new fetch: ", fetch);
    console.log(`origin fetch equals new fetch: ${originFetch === fetch}`)

    try {
        const response = await fetch(new Request("http://any/test", {
            method: "POST",
            body: JSON.stringify({})
        }))
    } catch (error) {
        console.error('request fail:', error)
    }
}
  1. You can observe that the fetch function obtained at the beginning and the fetch function obtained after 10 seconds are different. The second fetch function comes from teamsdevapp.vscode-ai-foundry-1.2.3\dist\extension.js, which results in a TypeError: RequestInit: duplex option is required when sending a body error
Image

Specifications

  • Version: teamsdevapp.vscode-ai-foundry 1.2.3
  • Platform: Windows 11/x64/VSCode 1.120.0

Metadata

Metadata

Assignees

Type

No type
No fields configured for issues without a type.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions