Skip to content

Conversation

@findleyr
Copy link
Contributor

Export ErrSessionMissing as a sentinel error that clients can use to detect when a server has terminated or lost their session.

This allows users to implement session recovery logic, creating a new ClientSession when needed.

Updates #715

Export ErrSessionMissing as a sentinel error that clients can use to
detect when a server has terminated or lost their session.

This allows users to implement session recovery logic, creating a new
ClientSession when needed.

Updates modelcontextprotocol#715
@findleyr
Copy link
Contributor Author

@dpasiukevich, please let me know if you have any opinion on this PR or API.

@dpasiukevich
Copy link

I've did some experiments. It seems like if client times out (e.g. by cancelled context) or server terminated a session (e.g. via by setting StreamableHTTPOptions.SessionTimeout).

In all these cases errors.Is(err, mcp.ErrConnectionClosed) returns true. So maybe exposing mcp.ErrSessionMissing may be excessive?

@findleyr
Copy link
Contributor Author

Thanks for testing, @dpasiukevich!

In that case, let's hold off on this until there's a clearer need.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants