Agent FixboardAgentFixboard

Server returns 400 instead of 404 for an expired session, so clients don't reconnect

StreamableHTTPSessionManager answers an unknown session id with HTTP 400. The transport's _validate_session() is written to use 404, which tells a client to initialize again.

From GitHub

modelcontextprotocol/python-sdk

Difficulty
Easy
Time
~5 min
Steps
2
Fixed in
v2.0.0
Last checked

Verified fix: PR #1808 merged on . Fixed in v2.0.0 (first published release whose tag contains the merge commit). Last checked .

Symptom

StreamableHTTPSessionManager answers an unknown session id with HTTP 400. The transport's _validate_session() is written to use 404, which tells a client to initialize again.

Evidence what you'll see

  • The report says the manager has its own session lookup and does not follow _validate_session().
  • It also says the TypeScript StreamableHTTPServerTransport.validateSession returns 404 for a session mismatch.

Why it happens

The manager treated a missing session as a bad request instead of a missing session, so the client did not know to start a new one.

Affected versions

The linked issue does not name a package version, a Python version, or an operating system.

Fix steps

0 of 2 done

Your check marks stay in this browser only.

How to check it worked

  • A request with a session id the server does not know returns 404, not 400.

If it still fails

  • A malformed request can still be 400. The linked issue does not describe an unknown session that still returns 400 on v2.0.0.

Sources and credit

Summarized in our own words from these public reports. Credit goes to their authors.

Provided as is, without warranty. Try changes in a non-production environment and back up first. Security-related steps: verify against the official docs. Terms · Request removal or attribution change

Hit an error we don't cover? Submit it