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
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 };
}
});
```