fix(hooks): force child_process PTY in getPty and use explicit hook names in tests

This commit is contained in:
Taylor Mullen
2026-02-13 10:06:48 -08:00
parent 45ecc6de1c
commit 6e78dc7300
2 changed files with 9 additions and 2 deletions
+6 -2
View File
@@ -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,
},
+3
View File
@@ -18,6 +18,9 @@ export interface PtyProcess {
}
export const getPty = async (): Promise<PtyImplementation> => {
if (process.env['GEMINI_PTY_INFO'] === 'child_process') {
return null;
}
try {
const lydell = '@lydell/node-pty';
const module = await import(lydell);