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'); + }); +});