Skip to content

[Server] Stop a deleted session from coming back when an in-flight request saves it - #568

Open
chr-hertel wants to merge 2 commits into
modelcontextprotocol:mainfrom
chr-hertel:fix-session-resurrection
Open

chr-hertel wants to merge 2 commits into
modelcontextprotocol:mainfrom
chr-hertel:fix-session-resurrection

Conversation

@chr-hertel

Copy link
Copy Markdown
Member

A DELETE while a tool call still runs answers 2xx, but the call's final Session::save() writes the session back - and the id is valid again.

  • Session remembers whether the store held it when read or last saved
  • if so, save() checks exists() first and returns false instead of recreating a destroyed session
  • works for all bundled stores without touching SessionStoreInterface - a tiny window between exists() and write() remains, a tombstone would need a store contract change

Fixes chr-hertel#59

🤖 Generated with Claude Code

@chr-hertel chr-hertel added bug Something isn't working Server Issues & PRs related to the Server component labels Oct 10, 2026

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working Server Issues & PRs related to the Server component

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Server] Deleting a session while a call runs brings it back

1 participant