You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Add a new shutdown() method (ShutdownAsync in .NET, Shutdown in Go) that
sends the session.destroy RPC to the CLI without clearing event handlers.
This allows callers to observe the session.shutdown notification that the
CLI sends after responding to the destroy request.
The existing destroy() / DisposeAsync() method now calls shutdown()
internally before clearing handlers, preserving full backward
compatibility.
Updated E2E tests in all four SDKs to exercise the new method and assert
that the session.shutdown event is received. Updated API reference docs
in all language READMEs, docs/compatibility.md, and the docs-maintenance
agent.
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Copy file name to clipboardExpand all lines: dotnet/README.md
+5-1Lines changed: 5 additions & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -219,7 +219,11 @@ Get all events/messages from this session.
219
219
220
220
##### `DisposeAsync(): ValueTask`
221
221
222
-
Dispose the session and free resources.
222
+
Dispose the session and free resources. Calls `ShutdownAsync()` first if not already called.
223
+
224
+
##### `ShutdownAsync(CancellationToken): Task`
225
+
226
+
Shut down the session on the server without clearing local event handlers. Call this before `DisposeAsync()` when you want to observe the `SessionShutdownEvent`.
-`Abort(ctx context.Context) error` - Abort the currently processing message
171
171
-`GetMessages(ctx context.Context) ([]SessionEvent, error)` - Get message history
172
172
-`Destroy() error` - Destroy the session
173
+
-`Shutdown() error` - Shut down the session on the server without clearing local handlers (call before `Destroy()` to observe the `session.shutdown` event)
Copy file name to clipboardExpand all lines: nodejs/README.md
+5-1Lines changed: 5 additions & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -267,7 +267,11 @@ Get all events/messages from this session.
267
267
268
268
##### `destroy(): Promise<void>`
269
269
270
-
Destroy the session and free resources.
270
+
Destroy the session and free resources. Calls `shutdown()` first if not already called.
271
+
272
+
##### `shutdown(): Promise<void>`
273
+
274
+
Shut down the session on the server without clearing local event handlers. Call this before `destroy()` when you want to observe the `session.shutdown` event.
0 commit comments