Clean up sessions after legacy initialize parsing fails
I maintainer di solito rispondono entro 2 giorni
@bolinfest ci sta già lavorando.
Dal 14/10/2026.
Valutazione
Questa issue non è ancora stata valutata.
Descrizione
Problem
A legacy Streamable HTTP initialize response can include an MCP session ID in
its response headers while its JSON or SSE payload is malformed or empty. The
client currently parses the initialize payload before its normal session
cleanup state is established. If parsing fails, the worker exits without
sending the bounded DELETE for the session that the server already created.
The same gap exists when Auto lifecycle discovery falls back to legacy
initialize.
Proposed direction
- Capture the raw session ID from a JSON or SSE initialize response before
parsing it. - Retain the headers that were actually used for that initialize request.
- If initialize parsing fails, run the existing bounded DELETE behavior before
returning the parse error. - On successful parsing and protocol negotiation, replace that provisional
cleanup state with the normal negotiated session cleanup state. - Cover both direct legacy initialization and discovery fallback.
This proposal is deliberately limited to initialize parse failures. Draft
#1267 introduces a broader run_session/outer-cancellation lifecycle and also
centralizes cleanup. The focused change would not copy that refactor, stalled
body handling, or its cancellation suite. I would be happy to fold the narrow
case into #1267 instead if that is the preferred direction.
Planned validation
Source-module transport tests would supply malformed and empty initialize SSE
streams carrying a raw session ID. Direct initialize and Auto fallback cases
would verify failure plus exactly one DELETE for that raw session.
Would maintainers prefer this focused fix as a separate PR or as a test and
delta on #1267?
- Lingua principale
- Rust
- Stelle
- 4k
- Fork
- 662
- Merge medio
- 3g 20h
- PR unite (30g)
- 30
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 5 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 7 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
-
Expose OAuth discovery and registration results for application-owned flowsForse già presa @connor4312 l’ha presa oggi. Apertaenhancement P2 ready for work T-security
modelcontextprotocol/rust-sdk#1371 · 1 commento · 1 assegnatario ·
I maintainer di solito rispondono entro 2 giorni
-
Two rmcp tests fail on Windows: connection-refused text check and `npm` spawn in test_with_jsForse già presa @bolinfest l’ha presa 1 giorno fa. Apertabug P2 ready for work T-test
modelcontextprotocol/rust-sdk#1364 · 1 commento · 1 assegnatario ·
I maintainer di solito rispondono entro 2 giorni
Tutte le issue di modelcontextprotocol/rust-sdk
Issue simili
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 65/100
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 70/100
-
area: compat area: parsing bug
Difficoltà 2/5 1-3 ore Idoneità per principianti 72/100
reubeno/brush#1526 · 1 commento ·
I maintainer di solito rispondono entro 1 giorno
-
Volume eject does not refuse system, root or /home mountsForse già presa @bernardopg l’ha presa oggi. Aperta
Difficoltà 2/5 1-3 ore Idoneità per principianti 72/100
spacedriveapp/spacedrive#3159 ·
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 1/5 Meno di un'ora Idoneità per principianti 82/100