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.
This commit is contained in:
Christopher Pruijsen authored and GitHub committed 2026-10-22 03:18:01 +08:00
1 parent 48e7470041
commit f3537db34f
2 files changed
+7 -1

No files matched your search

+1 -1
View File
@@ -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");
@@ -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" },