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 resource-subscription handlers only on the stateful server
Addresses Tarek's review nit on #1672. The stateless server at "/stateless"
shared the stateful server's subscriptions dictionary, which he flagged as a
smell. The deeper issue: registering WithSubscribeToResourcesHandler /
WithUnsubscribeFromResourcesHandler unconditionally set
Capabilities.Resources.Subscribe = true, so the stateless server advertised
resources.subscribe in its initialize result and then rejected every
resources/subscribe call with -32603 (InternalError) via the null-SessionId
guard -- the "server bug" error code for a capability it deliberately can't
honor.
Resource subscriptions are meaningless in the stateless lifecycle anyway: there
is no stable SessionId to key the subscription table and no persistent SSE
stream to deliver notifications/resources/updated. So gate the two handlers
behind `if (!stateless)`. The stateless server no longer advertises
resources.subscribe (an actual subscribe now gets the SDK's standard capability
rejection), and the subscriptions dictionary is scoped to the stateful branch
that is its only user -- answering "does the stateless server need a dictionary?"
with a plain no.
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
0 commit comments