Add skipConversationRestore for before_branch hooks (#286)

This commit is contained in:
Nico Bailon 2025-12-22 18:26:08 -08:00 committed by GitHub
parent 4492a3f304
commit 2953a9d8d4
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
3 changed files with 14 additions and 2 deletions

View file

@ -154,7 +154,12 @@ pi.on("session", async (event, ctx) => {
if (event.reason === "before_clear") {
return { cancel: true };
}
// No return needed if not cancelling
// For before_branch only: create branch but skip conversation restore
// (useful for checkpoint hooks that restore files separately)
if (event.reason === "before_branch") {
return { skipConversationRestore: true };
}
});
```