From f3537db34f4e0b5ad73f3a532d251ac13fa4f0a3 Mon Sep 17 00:00:00 2001 From: Christopher Pruijsen Date: Wed, 21 Oct 2026 20:18:01 +0100 Subject: [PATCH] fix(setup): treat empty COPILOT_HOME as unset (#5047) `copilotDirectory` used nullish coalescing, so `COPILOT_HOME=""` produced the relative path `mcp-config.json`. Setup then planned and wrote the GitHub Copilot CLI registration into the current working directory, not `~/.copilot/mcp-config.json`, and doctor looked for it in the same wrong place. Use `||` like the sibling client homes (CODEX_HOME, KIMI_CODE_HOME, GROK_HOME, XDG_CONFIG_HOME), and as #2686 did for DSH_HOME. --- src/application/SupportedClients.ts | 2 +- tests/boundary/cli/clientProfileLifecycle.test.ts | 6 ++++++ 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/src/application/SupportedClients.ts b/src/application/SupportedClients.ts index 241c36f18f..d23f1d9ca5 100644 --- a/src/application/SupportedClients.ts +++ b/src/application/SupportedClients.ts @@ -360,7 +360,7 @@ const piAgentDirectory = ({ }; const copilotDirectory = ({ home, env }: ClientPathContext): string => - env.COPILOT_HOME ?? join(home, ".copilot"); + env.COPILOT_HOME || join(home, ".copilot"); const commandCodeDirectory = ({ home }: ClientPathContext): string => join(home, ".commandcode"); diff --git a/tests/boundary/cli/clientProfileLifecycle.test.ts b/tests/boundary/cli/clientProfileLifecycle.test.ts index 4f684e7a8f..cb32d9964e 100644 --- a/tests/boundary/cli/clientProfileLifecycle.test.ts +++ b/tests/boundary/cli/clientProfileLifecycle.test.ts @@ -122,6 +122,12 @@ const cases = [ config: ".grok/config.toml", skill: ".agents/skills", }, + { + client: "copilot_cli", + env: { COPILOT_HOME: "" }, + config: ".copilot/mcp-config.json", + skill: ".agents/skills", + }, { client: "omp", env: { PI_CODING_AGENT_DIR: "profile" },