feat(cli): discover Bash for Windows runners

Use Pi-style Bash discovery and launch behavior, exercise the packaged CLI shell, and wait for pending ZIP metadata reads before closing cancelled downloads.
This commit is contained in:
yiling
2026-11-18 10:57:04 +08:00
parent 776f6962b6
commit fd4dc211f8
18 changed files with 453 additions and 63 deletions
+9 -9
View File
@@ -40,15 +40,15 @@ describe('createRunnerBashTool', () => {
const createMockOnUpdate = () => vi.fn()
it('tells the agent to use the runner OS and shell syntax', () => {
const tool = createRunnerBashTool(
{},
{ environment: { platform: 'win32', shell: 'C:\\Windows\\System32\\cmd.exe' } },
)
expect(tool.description).toContain('Runner OS: win32')
expect(tool.description).toContain('cmd.exe')
expect(tool.description).toContain('Use syntax and programs compatible with this environment')
})
it.each(['C:\\Windows\\System32\\cmd.exe', 'C:\\Program Files\\Git\\bin\\bash.exe'])(
'tells the agent to use the runner OS and shell syntax for %s',
(shell) => {
const tool = createRunnerBashTool({}, { environment: { platform: 'win32', shell } })
expect(tool.description).toContain('Runner OS: win32')
expect(tool.description).toContain(shell)
expect(tool.description).toContain('Use syntax and programs compatible with this environment')
},
)
it('should execute a command on the runner with injected env vars', async () => {
const tool = createRunnerBashTool(