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
Register sessions before RPC and add SessionConfig.OnEvent
Register sessions in the client's sessions map before issuing the
session.create and session.resume RPC calls, so that events emitted
by the CLI during the RPC (e.g. session.start, permission requests,
tool calls) are not dropped. Previously, sessions were registered
only after the RPC completed, creating a window where notifications
for the session had no target.
The session ID is now generated client-side (via UUID) rather than
extracted from the server response. On RPC failure, the session is
cleaned up from the map.
Add a new OnEvent property to each SDK's session configuration
(SessionConfig / ResumeSessionConfig) that registers an event handler
on the session before the create/resume RPC is issued. This guarantees
that early events emitted by the CLI during session creation (e.g.
session.start) are delivered to the handler, unlike calling On() after
createSession() returns.
Changes across all four SDKs (Node.js, Python, Go, .NET):
- Generate sessionId client-side before the RPC
- Create and register the session in the sessions map before the RPC
- Set workspacePath from the RPC response after it completes
- Remove the session from the map if the RPC fails
- Add OnEvent/on_event config property wired up before the RPC
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
0 commit comments