Streamable HTTP client logs a WARNING for valid 202 Accepted on session termination (DELETE)
Dieses Issue hat noch niemand übernommen.
Bewertung
- Schwierigkeit
- 2/5
- Geschätzter Aufwand
- 1-3 Stunden
- Anfängerfreundlichkeit
- 85/100
- Issue-Typ
- Bug
- Klarheit
- Klar beschrieben
- Aktivitätsstatus
- Aktiv
- Tech-Stack
- python
- Bereich
- api, networking
Rechercherichtung
Beginne in mcp/client/streamable_http.py bei der Verarbeitung der DELETE-Antwort zur Sitzungsbeendigung. Überprüfe, dass eine 202-Antwort ohne Warnung als erfolgreich behandelt wird, während 405 weiterhin ein Debug-Fall bleibt und andere nicht erfolgreiche Status weiterhin Warnungen auslösen; führe die relevante Client-Testsuite aus, falls verfügbar.
Vom Indexierungsmodell aus dem Issue-Text verfasst.
Beschreibung
Problem
mcp/client/streamable_http.py treats any DELETE session-termination response outside {200, 204} as a failure and logs:
WARNING mcp.client.streamable_http: Session termination failed: 202
But 202 Accepted is a valid, spec-compliant response for an asynchronous delete — the server accepted the request and will process it later. The current code path:
if response.status_code == 405:
logger.debug("Server does not allow session termination")
elif response.status_code not in (200, 204):
logger.warning(f"Session termination failed: {response.status_code}")
Evidence
A long-running Hermes Agent (NousResearch) deployment with several Streamable HTTP MCP servers accumulated 72 Session termination failed: 202 warnings in ~36 hours in errors.log — pure noise from servers that correctly answer 202 to asynchronous termination. Real failures (connection errors) also surface through this same line, so the constant false positives bury the signal.
Suggested fix
Treat 2xx as success on termination, e.g.:
if response.status_code == 405:
logger.debug("Server does not allow session termination")
elif 200 <= response.status_code < 300:
pass # 200/202/204 all acceptable
else:
logger.warning(f"Session termination failed: {response.status_code}")
Environment
mcpPython SDK (client, streamable HTTP transport), observed on recent Hermes 0.21.x installs- Servers: multiple Streamable HTTP MCP endpoints (remote + local)
Happy to send a PR if the direction is agreed.
- Vorherrschende Sprache
- Python
- Sterne
- 24.3k
- Forks
- 4k
- Ø Merge
- 1 T. 1 Std.
- Gemergte PRs (30 T.)
- 31
Beitragsleitfaden
Erste Schritte
- Lesen Sie das ganze Issue und danach den Beitragsleitfaden des Projekts.
- Schreiben Sie ins Issue, dass Sie es übernehmen — das erspart doppelte Arbeit.
- Forken Sie das Repository und arbeiten Sie in einem Branch.
- Öffnen Sie einen Pull Request, der die Issue-Nummer nennt.
Mehr aus modelcontextprotocol/python-sdk
-
v1 v2
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 76/100
modelcontextprotocol/python-sdk#3545 · 1 Kommentar ·
-
v1 v2
Schwierigkeit 1/5 Unter einer Stunde Anfängerfreundlichkeit 91/100
modelcontextprotocol/python-sdk#3508 · 2 Kommentare ·
-
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 64/100
modelcontextprotocol/python-sdk#3504 ·
-
v1 v2
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 82/100
modelcontextprotocol/python-sdk#3492 · 1 Kommentar ·
-
v1
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 78/100
modelcontextprotocol/python-sdk#3487 · 3 Kommentare ·
Alle Issues in modelcontextprotocol/python-sdk
Ähnliche Issues
-
link-check link-check:sphinx-theme
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 72/100
-
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 65/100
qgis/QGIS-Documentation#11275 ·
-
bug priority:normal ready-for-dev
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 88/100
OpenHands/extensions#626 · 1 Kommentar ·
-
Schwierigkeit 1/5 Unter einer Stunde Anfängerfreundlichkeit 90/100
CSCfi/sd-search-api#39 ·
-
Schwierigkeit 1/5 Unter einer Stunde Anfängerfreundlichkeit 90/100