From 2a9c60ebf474a890132ee08bed5e89d1a44af642 Mon Sep 17 00:00:00 2001 From: Neil Date: Sat, 19 Sep 2026 01:42:12 -0700 Subject: [PATCH] test(antigravity): use typed async process runner for hook launches --- src/main/agent-hooks/posix-hook-exec-command.test.ts | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/main/agent-hooks/posix-hook-exec-command.test.ts b/src/main/agent-hooks/posix-hook-exec-command.test.ts index fc4ec540dc3..12ffb2f4b97 100644 --- a/src/main/agent-hooks/posix-hook-exec-command.test.ts +++ b/src/main/agent-hooks/posix-hook-exec-command.test.ts @@ -2,7 +2,7 @@ import { afterEach, beforeEach, describe, expect, it } from 'vitest' import { chmodSync, mkdtempSync, rmSync, writeFileSync } from 'node:fs' import { tmpdir } from 'node:os' import { join } from 'node:path' -import { runProcessSync } from '../../shared/child-process/run-process' +import { runProcess } from '../../shared/child-process/run-process' import { wrapPosixHookCommandForExec } from './posix-hook-command' import { shlexSplit } from './posix-hook-exec-command.test-fixture' @@ -24,7 +24,7 @@ describe.skipIf(process.platform === 'win32')('POSIX exec hook command', () => { it.each(['present', 'missing', 'not-executable', 'missing-env'])( 'preserves the gate response with a %s script', - (state) => { + async (state) => { const script = join(root, "hook 'quoted' $literal `name` 日本語.sh") writeFileSync(script, '#!/bin/sh\nprintf \'%s\\n\' "$ORCA_TEST_EVENT"\ncat >/dev/null\n', { mode: 0o700 @@ -47,10 +47,10 @@ describe.skipIf(process.platform === 'win32')('POSIX exec hook command', () => { throw new Error('missing hook program') } for (const route of ['exec', 'shell']) { - const result = runProcessSync({ + const result = await runProcess({ program: route === 'exec' ? program : '/bin/sh', args: route === 'exec' ? args : ['-c', command], - input: Buffer.from('{"toolCall":{"name":"read_file"}}'), + input: '{"toolCall":{"name":"read_file"}}', env: { ...process.env, ORCA_TEST_REQUIRED: state === 'missing-env' ? '' : '1' }, timeoutMs: 5000 })