mirror of
https://github.com/badlogic/pi-mono.git
synced 2026-11-05 23:37:25 +00:00
fix(extensions): emit compaction failed for extensions (#8241)
* fix(extensions): emit compaction failed * changelog yeet
This commit is contained in:
parent
df018b6020
commit
a6b1dbceb1
7 changed files with 139 additions and 10 deletions
|
|
@ -330,7 +330,8 @@ user sends another prompt ◄─────────────────
|
|||
|
||||
/compact or auto-compaction
|
||||
├─► session_before_compact (can cancel or customize)
|
||||
└─► session_compact
|
||||
├─► session_compact (success)
|
||||
└─► session_compact_failed (failure or abort)
|
||||
|
||||
/tree navigation
|
||||
├─► session_before_tree (can cancel or customize)
|
||||
|
|
@ -448,7 +449,7 @@ pi.on("session_before_fork", async (event, ctx) => {
|
|||
After a successful fork or clone, pi emits `session_shutdown` for the old extension instance, reloads and rebinds extensions for the new session, then emits `session_start` with `reason: "fork"` and `previousSessionFile`.
|
||||
Do cleanup work in `session_shutdown`, then reestablish any in-memory state in `session_start`.
|
||||
|
||||
#### session_before_compact / session_compact
|
||||
#### session_before_compact / session_compact / session_compact_failed
|
||||
|
||||
Fired on compaction. See [compaction.md](compaction.md) for details.
|
||||
|
||||
|
|
@ -479,6 +480,14 @@ pi.on("session_compact", async (event, ctx) => {
|
|||
// event.reason - "manual" (/compact), "threshold", or "overflow"
|
||||
// event.willRetry - whether the aborted turn is retried after compaction (overflow recovery)
|
||||
});
|
||||
|
||||
pi.on("session_compact_failed", async (event, ctx) => {
|
||||
// event.reason - "manual" (/compact), "threshold", or "overflow"
|
||||
// event.errorMessage - present for non-abort failures
|
||||
// event.aborted - true for cancelled/aborted compactions
|
||||
// event.willRetry - whether the aborted turn would have retried after compaction
|
||||
// event.fromExtension - whether extension-provided compaction content was being used
|
||||
});
|
||||
```
|
||||
|
||||
#### session_before_tree / session_tree
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue