Hacktoberfest 2026: le issue che i maintainer hanno segnato per ottobre, aperte e adatte ai principianti. Sfoglia le issue Hacktoberfest

Clean up sessions after legacy initialize parsing fails

Aperta
#1,357 1 commento 0 reazioni 1 assegnatario Vedi su GitHub

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

bug P2 ready for work T-transport

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

Apri in Codespaces

Avvia il container di sviluppo del progetto nel browser, con il tuo account GitHub.

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di modelcontextprotocol/rust-sdk

Tutte le issue di modelcontextprotocol/rust-sdk

Issue simili

Altre issue su Rust

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.