Hacktoberfest 2026:メンテナが10月に向けて印を付けた、オープンで初心者向けの issue。 Hacktoberfest の issue を見る

Clean up sessions after legacy initialize parsing fails

オープン
#1,357 コメント 1 件 リアクション 0 件 担当者 1 名 GitHub で見る

メンテナーはふだん 3 日以内に返信

@bolinfest がすでに取り組んでいます。

2026年10月14日 から。

評価

この issue はまだ評価されていません。

説明

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?

主要言語
Rust
スター
4k
フォーク
662
平均マージ
3日 19時間
マージ済み PR(30日)
35

環境構築

Codespaces で開く

このプロジェクトの開発コンテナを、あなたの GitHub アカウントでブラウザ上に起動します。

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

modelcontextprotocol/rust-sdk のほかの issue

modelcontextprotocol/rust-sdk の issue をすべて見る

似ている issue

Rust の issue をもっと見る

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。