fix(coding-agent): emit session name changes to extensions
This commit is contained in:
@@ -322,6 +322,9 @@ user sends another prompt ◄─────────────────
|
||||
├─► session_start { reason: "fork", previousSessionFile }
|
||||
└─► resources_discover { reason: "startup" }
|
||||
|
||||
/name or pi.setSessionName()
|
||||
└─► session_info_changed
|
||||
|
||||
/compact or auto-compaction
|
||||
├─► session_before_compact (can cancel or customize)
|
||||
└─► session_compact
|
||||
@@ -395,6 +398,17 @@ pi.on("session_start", async (event, ctx) => {
|
||||
});
|
||||
```
|
||||
|
||||
#### session_info_changed
|
||||
|
||||
Fired when the current session display name is set via `/name`, RPC, or `pi.setSessionName()`.
|
||||
|
||||
```typescript
|
||||
pi.on("session_info_changed", async (event, ctx) => {
|
||||
// event.name - current normalized name, or undefined if cleared
|
||||
ctx.ui.notify(`Session renamed: ${event.name ?? "(none)"}`, "info");
|
||||
});
|
||||
```
|
||||
|
||||
#### session_before_switch
|
||||
|
||||
Fired before starting a new session (`/new`) or switching sessions (`/resume`).
|
||||
|
||||
Reference in New Issue
Block a user