Mark RunSessionHandler experimental (MCPEXP002) (#1383)
Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com> Co-authored-by: halter73 <54385+halter73@users.noreply.github.com> Co-authored-by: jeffhandley <1031940+jeffhandley@users.noreply.github.com>
This commit is contained in:
parent
4e68a4e9ec
commit
84cd6917bb
1 changed files with 82 additions and 4 deletions
|
|
@ -51,6 +51,7 @@ builder.Services
|
|||
.WithHttpTransport(options =>
|
||||
{
|
||||
// Add a RunSessionHandler to remove all subscriptions for the session when it ends
|
||||
#pragma warning disable MCPEXP002 // RunSessionHandler is experimental
|
||||
options.RunSessionHandler = async (httpContext, mcpServer, token) =>
|
||||
{
|
||||
if (mcpServer.SessionId == null)
|
||||
|
|
@ -76,6 +77,7 @@ builder.Services
|
|||
subscriptions.TryRemove(mcpServer.SessionId, out _);
|
||||
}
|
||||
};
|
||||
#pragma warning restore MCPEXP002
|
||||
})
|
||||
.WithTools<AddTool>()
|
||||
.WithTools<AnnotatedMessageTool>()
|
||||
|
|
|
|||
Loading…
Reference in a new issue