Client never answers a server `ping` sent during the `initialize` handshake
I maintainer di solito rispondono entro 2 giorni
Valutazione
Questa issue non è ancora stata valutata.
Descrizione
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.
- Lingua principale
- Rust
- Stelle
- 4k
- Fork
- 662
- Merge medio
- 3g 11h
- PR unite (30g)
- 36
Preparare l'ambiente
Avvia il container di sviluppo del progetto nel browser, con il tuo account GitHub.
- Nessun Dockerfile né file Docker Compose
- Nessun modello di pull request
- Leggi la guida per i contributori
Come iniziare
- Leggi tutta la issue e poi la guida ai contributi del progetto.
- Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
- Fai un fork del repository e lavora su un branch.
- Apri una pull request che faccia riferimento al numero della issue.
Altre issue di modelcontextprotocol/rust-sdk
-
Streamable HTTP client: a 401 or 403 with a JSON-RPC error body and no WWW-Authenticate loses its HTTP statusForse già presa @aton-of-data l’ha presa 7 giorni fa. Apertabug P2 ready for work T-security T-transport
Difficoltà 2/5 1-3 ore Idoneità per principianti 68/100
modelcontextprotocol/rust-sdk#1339 ·
I maintainer di solito rispondono entro 2 giorni
-
auth: refresh_token() requests offline_access that was never granted, so refreshes fail with invalid_scopeForse già presa @jstar0 l’ha presa 10 giorni fa. Apertabug P1 ready for work T-security T-transport
Difficoltà 2/5 1-3 ore Idoneità per principianti 65/100
modelcontextprotocol/rust-sdk#1330 ·
I maintainer di solito rispondono entro 2 giorni
-
P3 question Stale T-documentation T-enhancement
Difficoltà 1/5 Meno di un'ora Idoneità per principianti 86/100
modelcontextprotocol/rust-sdk#1155 · 1 commento ·
I maintainer di solito rispondono entro 2 giorni
-
outputSchema is generated for the deserialize contract; tool results are serialisedForse già presa @connor4312 l’ha presa 2 giorni fa. Apertabug P2 ready for work T-handler
modelcontextprotocol/rust-sdk#1374 · 2 commenti · 1 assegnatario ·
I maintainer di solito rispondono entro 2 giorni
-
Streamable HTTP client: update the stored endpoint URI after a 308Forse già presa @connor4312 l’ha presa 2 giorni fa. Apertaenhancement P3 T-transport
modelcontextprotocol/rust-sdk#1373 · 2 commenti · 1 assegnatario ·
I maintainer di solito rispondono entro 2 giorni
Tutte le issue di modelcontextprotocol/rust-sdk
Issue simili
-
area:config area:security bug good first issue platform:linux platform:windows priority:medium
Difficoltà 2/5 1-3 ore Idoneità per principianti 78/100
rtk-ai/rtk#4651 · 1 commento ·
I maintainer di solito rispondono entro 1 giorno
-
documentation P2
Difficoltà 2/5 1-3 ore Idoneità per principianti 88/100
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 72/100
vllm-project/agentic-api#463 ·
I maintainer di solito rispondono entro 2 giorni
-
bug good first issue priority:high
Difficoltà 2/5 1-3 ore Idoneità per principianti 88/100
Konfirm-xyz/konfirm-contracts#163 ·
I maintainer di solito rispondono entro 1 giorno
-
GL backend reports vendor id 0 for AMD GPUs on Windows (GL_VENDOR is "ATI Technologies Inc.")Aperta
Difficoltà 2/5 1-3 ore Idoneità per principianti 84/100
I maintainer di solito rispondono entro 1 giorno