fix(hooks): prevent SessionEnd from firing twice in non-interactive mode (#22139)

Co-authored-by: Tommaso Sciortino <sciortino@gmail.com>
This commit is contained in:
krishdef7
2026-03-28 05:09:48 +05:30
committed by GitHub
parent b5529c2475
commit bf6dae4690
2 changed files with 86 additions and 9 deletions
-5
View File
@@ -671,11 +671,6 @@ export async function main() {
}
}
// Register SessionEnd hook for graceful exit
registerCleanup(async () => {
await config.getHookSystem()?.fireSessionEndEvent(SessionEndReason.Exit);
});
if (!input) {
debugLogger.error(
`No input provided via stdin. Input can be provided by piping data into gemini or using the --prompt option.`,