Accept empty HTTP responses for one-way MCP messages#30642
Accept empty HTTP responses for one-way MCP messages#30642raymond-openai wants to merge 2 commits into
Conversation
|
All contributors have signed the CLA ✍️ ✅ |
|
I have read the CLA Document and I hereby sign the CLA |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 580ad22d3b
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| } | ||
| Some(content_type) if content_type.starts_with(JSON_MIME_TYPE) => { | ||
| let body = collect_body(&mut body_stream).await?; | ||
| if body.is_empty() && matches!(message, JsonRpcMessage::Notification(_)) { |
There was a problem hiding this comment.
Handle empty replies for client responses too
When a Streamable HTTP server sends a request to the client, such as elicitation/create or openai/form, RMCP answers by posting a JsonRpcMessage::Response back through this same adapter. That response also does not expect a JSON-RPC reply, so a server that returns the same empty 200 application/json tolerated here for notifications still falls through to serde_json::from_slice(&[]) and fails the elicitation path. Treat client Response/Error messages as accepted on an empty successful body, or otherwise cover this no-reply message class before deserializing.
Useful? React with 👍 / 👎.
Summary
Addresses the empty-response transport failure in #20982. The separate silent codex exec error-surfacing behavior remains out of scope.
Testing