fix(mcp): handle empty 202 notification acknowledgements - #1539
Conversation
|
You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard. |
Summary of ChangesHello, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed! This pull request addresses a critical issue where the MCP Streamable HTTP notifications failed to process Highlights
Using Gemini Code AssistThe full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips. Invoking Gemini You can request assistance from Gemini at any point by creating a comment using either
Customization To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a Limitations & Feedback Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for GitHub and other Google products, sign up here. Footnotes
|
There was a problem hiding this comment.
Code Review
This pull request fixes an issue where the MCP HTTP transport would fail when a server returns a 202 Accepted response with an empty body, which is a valid acknowledgement for notifications. The change correctly handles this case by creating a default success response. A new test is added to verify this behavior.
My review includes suggestions to improve the new test code by using an existing helper function for creating requests and by consistently using expect() instead of unwrap() for better error reporting, in line with repository guidelines.
Co-authored-by: gemini-code-assist[bot] <176961590+gemini-code-assist[bot]@users.noreply.github.com>
9038672 to
2cc7bd8
Compare
* fix(mcp): handle empty 202 notification acknowledgements * test(mcp): tighten accepted response regression coverage * Update src/tools/mcp/http_transport.rs Co-authored-by: gemini-code-assist[bot] <176961590+gemini-code-assist[bot]@users.noreply.github.com> --------- Co-authored-by: gemini-code-assist[bot] <176961590+gemini-code-assist[bot]@users.noreply.github.com>
* fix(mcp): handle empty 202 notification acknowledgements * test(mcp): tighten accepted response regression coverage * Update src/tools/mcp/http_transport.rs Co-authored-by: gemini-code-assist[bot] <176961590+gemini-code-assist[bot]@users.noreply.github.com> --------- Co-authored-by: gemini-code-assist[bot] <176961590+gemini-code-assist[bot]@users.noreply.github.com>
Fixes #1436.\n\nMCP Streamable HTTP notifications may legitimately return 202 Accepted with an empty body. The HTTP transport now treats that as an empty JSON-RPC acknowledgement instead of trying to parse JSON, which unblocks session initialization against servers such as kubernetes-mcp-server.\n\nValidation:\n- cargo test -p ironclaw --lib http_transport::tests::test_accepted_notification_returns_empty_response -- --nocapture\n- cargo clippy -p ironclaw --lib --all-features -- -D warnings