test(agent-launch): cover the Windows QA stub, a grok override that exits at once

This commit is contained in:
Brennan Benson
2026-10-02 01:28:09 -07:00
parent d96b1e75f2
commit 2603d2cda1
@@ -31,6 +31,7 @@ function bashRunsLaunchLineThatExits(): string[] {
} }
type HostAnswers = { type HostAnswers = {
agent?: 'claude' | 'grok'
host: { remote: boolean; windows: boolean } host: { remote: boolean; windows: boolean }
cached: string | null cached: string | null
scanned: string | null scanned: string | null
@@ -49,6 +50,18 @@ const HOSTS: [string, HostAnswers, () => string[]][] = [
}, },
bashRunsLaunchLineThatExits bashRunsLaunchLineThatExits
], ],
// The QA stub: a `grok` override that exits at once, which takes the composer-marker wait.
[
'Windows Git Bash, grok',
{
agent: 'grok',
host: { remote: false, windows: true },
cached: 'node',
scanned: 'bash',
shellAlone: false
},
bashRunsLaunchLineThatExits
],
[ [
'Windows WSL', 'Windows WSL',
{ host: { remote: false, windows: true }, cached: 'claude', scanned: 'wsl', shellAlone: false }, { host: { remote: false, windows: true }, cached: 'claude', scanned: 'wsl', shellAlone: false },
@@ -79,10 +92,14 @@ function launchedPane(answers: HostAnswers) {
confirmShellForeground: async () => answers.shellAlone confirmShellForeground: async () => answers.shellAlone
} }
const readForeground = (ptyId: string) => const readForeground = (ptyId: string) =>
readLaunchedAgentForeground(controller, answers.host, ptyId, 'claude') readLaunchedAgentForeground(controller, answers.host, ptyId, answers.agent ?? 'claude')
const writes: string[] = [] const writes: string[] = []
const runtime = { const runtime = {
waitForFreshWorkerComposer: async (_handle: string, agent: 'claude', timeoutMs: number) => { waitForFreshWorkerComposer: async (
_handle: string,
agent: 'claude' | 'grok',
timeoutMs: number
) => {
const ptyId = await waitForWorktreeStartupDraft( const ptyId = await waitForWorktreeStartupDraft(
{ {
getPtyId: () => PTY_ID, getPtyId: () => PTY_ID,
@@ -151,7 +168,7 @@ describe('a launch prompt after the launched agent exits at startup', () => {
typeof deliverTerminalAgentLaunchPrompt typeof deliverTerminalAgentLaunchPrompt
>[0]['runtime'], >[0]['runtime'],
handle: 'term-1', handle: 'term-1',
agent: 'claude', agent: answers.agent ?? 'claude',
freshLaunch: true, freshLaunch: true,
text: 'QA prompt that must never run as a shell command' text: 'QA prompt that must never run as a shell command'
}) })