You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on May 24, 2026. It is now read-only.
CopilotClientOptions.Environment silently clears and replaces the child process environment rather than merging with the inherited environment. Decompiled from GitHub.Copilot.SDK v0.2.0:
Any embedder that sets Environment to augment PATH (the obvious use case — MAUI apps don't inherit terminal PATH) will unknowingly strip critical platform variables (COMSPEC, SystemRoot, TEMP, LOCALAPPDATA, etc.) from the CLI child process.
On Windows this breaks ConPTY shell spawning entirely — the CLI's PowerShell tool fails with File not found: (empty path) because ConPTY can't resolve the shell executable without these env vars.
Expected behavior
Either:
Merge options.Environment with the inherited environment (set/override only the specified keys), or
Document clearly that Environment is a full replacement and embedders must copy Environment.GetEnvironmentVariables() first
Workaround
Copy the full system environment before augmenting:
varenv=newDictionary<string,string>(OperatingSystem.IsWindows()?StringComparer.OrdinalIgnoreCase:StringComparer.Ordinal);foreach(DictionaryEntryentryinEnvironment.GetEnvironmentVariables()){if(entry.Keyisstringkey&&entry.Valueisstringval)env[key]=val;}// Now augment PATH, HOME, etc.options.Environment=env;
External: github/copilot-sdk
Problem
CopilotClientOptions.Environmentsilently clears and replaces the child process environment rather than merging with the inherited environment. Decompiled fromGitHub.Copilot.SDKv0.2.0:Any embedder that sets
Environmentto augment PATH (the obvious use case — MAUI apps don't inherit terminal PATH) will unknowingly strip critical platform variables (COMSPEC,SystemRoot,TEMP,LOCALAPPDATA, etc.) from the CLI child process.On Windows this breaks ConPTY shell spawning entirely — the CLI's PowerShell tool fails with
File not found:(empty path) because ConPTY can't resolve the shell executable without these env vars.Expected behavior
Either:
options.Environmentwith the inherited environment (set/override only the specified keys), orEnvironmentis a full replacement and embedders must copyEnvironment.GetEnvironmentVariables()firstWorkaround
Copy the full system environment before augmenting:
PolyPilot fix
PR #439