mirror of
https://github.com/google-gemini/gemini-cli.git
synced 2026-04-30 15:04:16 -07:00
feat(hooks): Hook Session Lifecycle & Compression Integration (#14151)
This commit is contained in:
@@ -238,8 +238,18 @@ export class HookRunner {
|
||||
debugLogger.warn(`Hook stdin error: ${err}`);
|
||||
}
|
||||
});
|
||||
child.stdin.write(JSON.stringify(input));
|
||||
child.stdin.end();
|
||||
|
||||
// Wrap write operations in try-catch to handle synchronous EPIPE errors
|
||||
// that occur when the child process exits before we finish writing
|
||||
try {
|
||||
child.stdin.write(JSON.stringify(input));
|
||||
child.stdin.end();
|
||||
} catch (err) {
|
||||
// Ignore EPIPE errors which happen when the child process closes stdin early
|
||||
if (err instanceof Error && 'code' in err && err.code !== 'EPIPE') {
|
||||
debugLogger.warn(`Hook stdin write error: ${err}`);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// Collect stdout
|
||||
|
||||
Reference in New Issue
Block a user