feat(hooks): Hook Session Lifecycle & Compression Integration (#14151)

This commit is contained in:
Edilmo Palencia
2025-12-03 09:04:13 -08:00
committed by GitHub
parent 7a6d3067c6
commit 1c12da1fad
27 changed files with 1026 additions and 302 deletions
+12 -2
View File
@@ -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