Client never answers a server `ping` sent during the `initialize` handshake
Maintainer thường phản hồi trong vòng 2 ngày
Đánh giá
Issue này chưa được đánh giá.
Mô tả
Describe the bug
This is about the 2025-11-25 initialize handshake. While the client waits for the initialize response, expect_response in service/client.rs drops any ping from the server:
// Server could send pings before handshake
ServerJsonRpcMessage::Request(ref request)
if matches!(request.request, ServerRequest::PingRequest(_)) =>
{
tracing::trace!("Received ping request. Ignored.")
}
Nothing is written back, so the server's ping never gets a response. A server that times out its pings can treat the connection as stale and drop it. A ping sent after notifications/initialized is answered normally.
The server side already does this. #745 made the server answer a client ping that arrives before initialize.
To Reproduce (main at 8d226f4)
Over a tokio::io::duplex transport, with both sides on 2025-11-25, a raw server reads initialize, writes a ping, and then writes the InitializeResult:
<- {"jsonrpc":"2.0","id":0,"method":"initialize","params":{"capabilities":{},"clientInfo":{"name":"rmcp","version":"3.5.1"},"protocolVersion":"2025-11-25"}}
-> {"jsonrpc":"2.0","id":"srv-ping-pre","method":"ping"}
-> {"jsonrpc":"2.0","id":0,"result":{"protocolVersion":"2025-11-25","capabilities":{},"serverInfo":{...}}}
After notifications/initialized arrives, it sends a second ping (srv-ping-post) for comparison. Everything the client writes back:
{"jsonrpc":"2.0","method":"notifications/initialized"}
{"jsonrpc":"2.0","id":"srv-ping-post","result":{}}
There is no response for srv-ping-pre.
Expected behavior
The client writes {"jsonrpc":"2.0","id":"srv-ping-pre","result":{}} during the handshake and then carries on waiting for the InitializeResult.
Additional context
The 2025-11-25 lifecycle lets the server send pings before it gets notifications/initialized, and the ping page says the receiver MUST respond promptly with an empty response.
expect_response is also used while waiting for server/discover. 2026-07-28 removes ping and servers there don't send requests, so I'd leave that path as it is and only answer during initialize.
I can open a PR for this.
- Ngôn ngữ chính
- Rust
- Star
- 4k
- Fork
- 662
- Merge trung bình
- 3 ngày 20 giờ
- Pull request đã merge (30 ngày)
- 30
Chuẩn bị môi trường
Khởi chạy dev container của dự án ngay trên trình duyệt, bằng tài khoản GitHub của bạn.
- Không có Dockerfile hay tệp Docker Compose
- Không có mẫu pull request
- Đọc hướng dẫn đóng góp
Bắt đầu từ đâu
- Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
- Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
- Fork repository và làm thay đổi trên một nhánh.
- Mở pull request có tham chiếu số hiệu của issue.
Issue khác của modelcontextprotocol/rust-sdk
-
Streamable HTTP client: a 401 or 403 with a JSON-RPC error body and no WWW-Authenticate loses its HTTP statusCó thể đã có người làm @aton-of-data đã nhận 5 ngày trước. Đang mởbug P2 ready for work T-security T-transport
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 68/100
modelcontextprotocol/rust-sdk#1339 ·
Maintainer thường phản hồi trong vòng 2 ngày
-
auth: refresh_token() requests offline_access that was never granted, so refreshes fail with invalid_scopeCó thể đã có người làm @jstar0 đã nhận 8 ngày trước. Đang mởbug P1 ready for work T-security T-transport
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 65/100
modelcontextprotocol/rust-sdk#1330 ·
Maintainer thường phản hồi trong vòng 2 ngày
-
P3 question Stale T-documentation T-enhancement
Độ khó 1/5 Dưới một giờ Mức phù hợp với người mới 86/100
modelcontextprotocol/rust-sdk#1155 · 1 bình luận ·
Maintainer thường phản hồi trong vòng 2 ngày
-
Expose OAuth discovery and registration results for application-owned flowsCó thể đã có người làm @connor4312 đã nhận hôm nay. Đang mởenhancement P2 ready for work T-security
modelcontextprotocol/rust-sdk#1371 · 1 bình luận · 1 người được giao ·
Maintainer thường phản hồi trong vòng 2 ngày
-
Two rmcp tests fail on Windows: connection-refused text check and `npm` spawn in test_with_jsCó thể đã có người làm @bolinfest đã nhận 1 ngày trước. Đang mởbug P2 ready for work T-test
modelcontextprotocol/rust-sdk#1364 · 1 bình luận · 1 người được giao ·
Maintainer thường phản hồi trong vòng 2 ngày
Tất cả issue của modelcontextprotocol/rust-sdk
Issue tương tự
-
build: Update rust versionCó thể đã có người làm Có pull request liên kết đang mở hoặc đã được merge. Đang mởdependencies
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 67/100
ibm-granite-community/granite-cli#229 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
setTargetAtTime booked ahead of time starts its curve early (values blow up before start_time)Đang mở
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 78/100
orottier/web-audio-api-rs#658 ·
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 84/100
aosama/astronomical#1318 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 78/100
Maintainer thường phản hồi trong vòng 1 ngày
-
bug: `shep kelpie finish all`Đang mởbug
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 66/100
shep-pm/shep-kelpie#980 ·
Maintainer thường phản hồi trong vòng 1 ngày