fix(coding-agent): add session_shutdown reasons closes #2863

This commit is contained in:
Mario Zechner
2026-04-20 23:10:49 +02:00
parent 1891b9ac01
commit 12d7161884
10 changed files with 75 additions and 30 deletions

View File

@@ -446,10 +446,12 @@ pi.on("session_tree", async (event, ctx) => {
#### session_shutdown
Fired on exit (Ctrl+C, Ctrl+D, SIGHUP, SIGTERM).
Fired before an extension runtime is torn down.
```typescript
pi.on("session_shutdown", async (_event, ctx) => {
pi.on("session_shutdown", async (event, ctx) => {
// event.reason - "quit" | "reload" | "new" | "resume" | "fork"
// event.targetSessionFile - destination session for session replacement flows
// Cleanup, save state, etc.
});
```