Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion plugin/scripts/session-end.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ async function main() {
headers: authHeaders(),
signal: AbortSignal.timeout(3e4)
}).catch(() => {});
setTimeout(() => process.exit(0), 1500).unref();
setTimeout(() => process.exit(0), 1500);
}
main();

Expand Down
6 changes: 5 additions & 1 deletion src/hooks/session-end.ts
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,11 @@ async function main() {
}).catch(() => {});
}

setTimeout(() => process.exit(0), 1500).unref();
// Force-exit after 1500ms regardless of in-flight fetches. Without this,
// .unref() makes the timer passive and pending fetch() calls keep the event
// loop alive until their AbortSignal timeouts fire (up to 120s), causing
// Claude Code to cancel the hook with "Hook cancelled".
setTimeout(() => process.exit(0), 1500);
}

main();