From 6e78dc7300afb367ce73126bece8c91f9161e113 Mon Sep 17 00:00:00 2001 From: Taylor Mullen Date: Fri, 13 Feb 2026 10:06:48 -0800 Subject: [PATCH] fix(hooks): force child_process PTY in getPty and use explicit hook names in tests --- integration-tests/hooks-system.test.ts | 8 ++++++-- packages/core/src/utils/getPty.ts | 3 +++ 2 files changed, 9 insertions(+), 2 deletions(-) diff --git a/integration-tests/hooks-system.test.ts b/integration-tests/hooks-system.test.ts index 373497492d..8f9cb8b8eb 100644 --- a/integration-tests/hooks-system.test.ts +++ b/integration-tests/hooks-system.test.ts @@ -1842,7 +1842,7 @@ console.log(JSON.stringify({ settings: { hooksConfig: { enabled: true, - disabled: [normalizePath(disabledCmd)], + disabled: ['hook-b'], }, hooks: { BeforeTool: [ @@ -1850,11 +1850,13 @@ console.log(JSON.stringify({ hooks: [ { type: 'command', + name: 'hook-a', command: enabledCmd, timeout: 60000, }, { type: 'command', + name: 'hook-b', command: disabledCmd, timeout: 60000, }, @@ -1914,7 +1916,7 @@ console.log(JSON.stringify({ settings: { hooksConfig: { enabled: true, - disabled: [normalizePath(disabledCmd)], + disabled: ['multi-hook-disabled'], }, hooks: { BeforeTool: [ @@ -1922,11 +1924,13 @@ console.log(JSON.stringify({ hooks: [ { type: 'command', + name: 'multi-hook-active', command: activeCmd, timeout: 60000, }, { type: 'command', + name: 'multi-hook-disabled', command: disabledCmd, timeout: 60000, }, diff --git a/packages/core/src/utils/getPty.ts b/packages/core/src/utils/getPty.ts index 2d7cb16fc5..35712b6de3 100644 --- a/packages/core/src/utils/getPty.ts +++ b/packages/core/src/utils/getPty.ts @@ -18,6 +18,9 @@ export interface PtyProcess { } export const getPty = async (): Promise => { + if (process.env['GEMINI_PTY_INFO'] === 'child_process') { + return null; + } try { const lydell = '@lydell/node-pty'; const module = await import(lydell);