-
Notifications
You must be signed in to change notification settings - Fork 610
"Client failed to initialize by explicit API call" bugfix #438
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
sink.must() must be executed, otherwise in the case of empty return (such as notify), the deliveredSink of sendMessage will not be able to process the stream correctly, resulting in Client failed to initialize by explicit API call
a blocking issue that I hope to resolve soon |
great |
@codezkk thanks you for reveling this issue. |
When building HttpClientStreamableHttpTransport, initailize will call notify, which will be triggered when processing the notify response. I think the main problem is that the responseEventSink of HttpClientStreamableHttpTransport#sendMessage does not correctly handle sink.next(). HttpClientStreamableHttpTransport build = HttpClientStreamableHttpTransport var client = McpClient.async(build) |
@codezkk thanks for the replay. I would appreciate if the PRs like this are accompanied with proper tests. |
…col versions - Add ProtocolVersions interface with version constants - Change protocolVersion() to protocolVersions() returning List<String> - Streamable HTTP clients now support both 2024-11-05 and 2025-03-26 - Fixes compatibility with MCP servers that return 2024-11-05 instead of 2025-03-26 Resolves modelcontextprotocol#436 Related to modelcontextprotocol#438 Signed-off-by: Christian Tzolov <christian.tzolov@broadcom.com>
…col versions - Add ProtocolVersions interface with version constants - Change protocolVersion() to protocolVersions() returning List<String> - Streamable HTTP clients now support both 2024-11-05 and 2025-03-26 - Fixes compatibility with MCP servers that return 2024-11-05 instead of 2025-03-26 Resolves #436 Related to #438 Signed-off-by: Christian Tzolov <christian.tzolov@broadcom.com>
…col versions - Add ProtocolVersions interface with version constants - Change protocolVersion() to protocolVersions() returning List<String> - Streamable HTTP clients now support both 2024-11-05 and 2025-03-26 - Fixes compatibility with MCP servers that return 2024-11-05 instead of 2025-03-26 Resolves #436 Related to #438 Signed-off-by: Christian Tzolov <christian.tzolov@broadcom.com>
Hi @codezkk, have you managed to reproduce the issue with a test? If not should i close this PR? |
Also seeing this issue, this PR fixed the error I was seeing (dropping the connection on initialize because its blocking on the initialized notification call). |
is there a plan to release this patch as 0.11.1? |
Sorry for being delayed by other things, I will deal with it today |
Thanks for adding a tests @codezkk I will have a look later today |
|
sink.next() must be executed, otherwise in the case of empty return (such as notify), the deliveredSink of sendMessage will not be able to process the stream correctly, resulting in Client failed to initialize by explicit API call
Motivation and Context
How Has This Been Tested?
Breaking Changes
Types of changes
Checklist
Additional context