fix(coding-agent): emit session name changes to extensions

This commit is contained in:
Alexey Zaytsev
2026-06-30 00:38:06 -05:00
parent 927e98068c
commit 726a9c526c
6 changed files with 49 additions and 1 deletions
+14
View File
@@ -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`).