From 3df850f64e7438c62418718e4ea6bd53bef59562 Mon Sep 17 00:00:00 2001 From: garrytan Date: Tue, 6 Oct 2026 18:42:23 +0000 Subject: [PATCH] fix(copilot): on Windows, run bash blocks in Git for Windows Bash (#3047) Copilot CLI on Windows ran gstack's extensionless helpers straight from PowerShell, which opened an app picker, and bare bash can resolve to WSL. The Copilot tool glossary (rendered into every Copilot skill) now says to run each bash block in Git for Windows Bash by its full path and never to translate a block into PowerShell. The PR's PowerShell repair skill and README section are not taken. Co-authored-by: nareshh74 --- hosts/copilot.ts | 2 +- test/host-config.test.ts | 10 ++++++++++ 2 files changed, 11 insertions(+), 1 deletion(-) diff --git a/hosts/copilot.ts b/hosts/copilot.ts index 6488a3458..a40672645 100644 --- a/hosts/copilot.ts +++ b/hosts/copilot.ts @@ -3,7 +3,7 @@ import { defineHost, GBRAIN_RESOLVERS, preambleToolGlossary } from './define-hos // GitHub Copilot CLI (#393). Ported from PR #2323 (@andrey-esipov) with ideas // from #396/#487 (@ridermw) and #1852 (@lolisaigao1234); disposition in // docs/ADDING_A_HOST.md "GitHub Copilot CLI". -const COPILOT_TOOL_GLOSSARY = '**GitHub Copilot tool names:** `AskUserQuestion` means your `ask_user` tool (one question per call: put the decision brief in the question and each option in the choices). `ExitPlanMode` means `exit_plan_mode`; the Agent tool means `task`; the Read tool means `view`; the Skill tool means `skill`. Copilot has no `mcp__*__AskUserQuestion` variant.'; +const COPILOT_TOOL_GLOSSARY = '**GitHub Copilot tool names:** `AskUserQuestion` means your `ask_user` tool (one question per call: put the decision brief in the question and each option in the choices). `ExitPlanMode` means `exit_plan_mode`; the Agent tool means `task`; the Read tool means `view`; the Skill tool means `skill`. Copilot has no `mcp__*__AskUserQuestion` variant. **On Windows (#3047):** run each bash block in Git for Windows Bash by its full path (usually `C:\\Program Files\\Git\\bin\\bash.exe`; bare `bash` can start WSL instead). Never translate a block into PowerShell, and never run an extensionless gstack helper from PowerShell directly: Windows opens an app picker instead of running it.'; const copilot = defineHost({ name: 'copilot', diff --git a/test/host-config.test.ts b/test/host-config.test.ts index f1f17526f..7a20b3146 100644 --- a/test/host-config.test.ts +++ b/test/host-config.test.ts @@ -790,3 +790,13 @@ describe('host renders name the host\'s own tools and identities (#2626, #2015, } }); }); + +describe('#3047: Copilot on Windows runs bash blocks in Git for Windows Bash', () => { + test('the Copilot tool glossary names Git Bash by full path and forbids PowerShell translation', async () => { + const { default: copilot } = await import('../hosts/copilot'); + const glossary = JSON.stringify(copilot.toolRewrites); + expect(glossary).toContain('Git for Windows Bash by its full path'); + expect(glossary).toContain('bare `bash` can start WSL'); + expect(glossary).toContain('Never translate a block into PowerShell'); + }); +});