Skip to content

Commit 3df850f

Browse files
garrytannareshh74
andcommitted
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 <[email protected]>
1 parent 9618336 commit 3df850f

2 files changed

Lines changed: 11 additions & 1 deletion

File tree

‎hosts/copilot.ts‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ import { defineHost, GBRAIN_RESOLVERS, preambleToolGlossary } from './define-hos
33
// GitHub Copilot CLI (#393). Ported from PR #2323 (@andrey-esipov) with ideas
44
// from #396/#487 (@ridermw) and #1852 (@lolisaigao1234); disposition in
55
// docs/ADDING_A_HOST.md "GitHub Copilot CLI".
6-
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.';
6+
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.';
77

88
const copilot = defineHost({
99
name: 'copilot',

‎test/host-config.test.ts‎

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -790,3 +790,13 @@ describe('host renders name the host\'s own tools and identities (#2626, #2015,
790790
}
791791
});
792792
});
793+
794+
describe('#3047: Copilot on Windows runs bash blocks in Git for Windows Bash', () => {
795+
test('the Copilot tool glossary names Git Bash by full path and forbids PowerShell translation', async () => {
796+
const { default: copilot } = await import('../hosts/copilot');
797+
const glossary = JSON.stringify(copilot.toolRewrites);
798+
expect(glossary).toContain('Git for Windows Bash by its full path');
799+
expect(glossary).toContain('bare `bash` can start WSL');
800+
expect(glossary).toContain('Never translate a block into PowerShell');
801+
});
802+
});

0 commit comments

Comments
 (0)