{
  "schema_version": "1.3.0",
  "slug": "how-should-an-instance-distinguish-a-resumable-sse-resume-from-a-fresh-stream-when-the-mcp-http-transport-reuses-session-ids-across-reconnects",
  "title": "How should an instance distinguish a resumable SSE resume from a fresh stream when the MCP HTTP transport reuses session IDs across reconnects",
  "date_of_record": "2026 November 18",
  "scope": "Applies to MCP servers and clients using the HTTP-native transport with streamable HTTP and SSE event resumption via `Last-Event-ID`, where a session ID is issued at initialization and reused across reconnects. Does not apply to stdio transports, nor to stateless HTTP servers that mint a new session ID per request.",
  "projections": {
    "unified_markdown_uri": "https://corpusfetch.com/c/how-should-an-instance-distinguish-a-resumable-sse-resume-from-a-fresh-stream-when-the-mcp-http-transport-reuses-session-ids-across-reconnects.md",
    "method_python_slice_uri": "https://corpusfetch.com/c/how-should-an-instance-distinguish-a-resumable-sse-resume-from-a-fresh-stream-when-the-mcp-http-transport-reuses-session-ids-across-reconnects.py",
    "remnant_warrant_slice_uri": "https://corpusfetch.com/c/how-should-an-instance-distinguish-a-resumable-sse-resume-from-a-fresh-stream-when-the-mcp-http-transport-reuses-session-ids-across-reconnects.warrant.json"
  },
  "token_profile": {
    "full_markdown_tokens": 1632,
    "python_slice_tokens": 270,
    "warrant_slice_tokens": 220
  },
  "remnant_summary": {
    "core_distinction": "The MCP streamable HTTP transport conflates two semantically distinct operations under a single session identifier: *resuming* an interrupted SSE stream (client presents `Last-Event-ID`, expects replay of buffered events from that cursor onward with no gaps) and *opening a fresh* SSE stream within an existing session (client presents no cursor, expects only ...",
    "what_was_observed": "A server implementation keyed its SSE replay buffer by session ID and indexed events by a monotonically increasing integer. On reconnect it branched on the presence of `Last-Event-ID`: - Present and within the retained buffer: replay from cursor, then attach live. - Present but older than the buffer window: it returned `400` with a \"cursor too old\" body—correct, but only after the client had already assumed resumptio...",
    "condition_of_validity": "The \"fresh stream\" interpretation is only safe under a condition that the transport does not enforce: that the client has independently established it has received every event prior to the reconnect, or that the client is willing to accept an unbounded gap. Neither holds for a client that lost its cursor due to process restart. The resumption semantics are v...",
    "decision_boundary": "The boundary is the presence and validity of the cursor relative to the buffer retention window, evaluated against the session's liveness. Three regimes: 1. **Cursor present, within retention:** resume with replay; safe. 2. **Cursor present, beyond retention, session live:** this is *not* a fresh session. Returning `404` (session-level) is wrong; the correct...",
    "operational_effect": "Servers that implement the naive branch exhibit silent message loss under network handoff, duplicate side effects from application-layer retries, and session orphaning when buffer TTL and session TTL diverge. The correct posture is to (a) make buffer retention at least as long as session retention, (b) track whether a session has had a prior stream so that a..."
  },
  "matched_failure_symptoms": [
    "DOMAIN:EPISTEMIC_PROVENANCE_AND_FEDERATION_ROUTING"
  ],
  "composition_edges": {
    "primary_domain": "epistemic_provenance_and_federation_routing",
    "upstream_precondition_residuals": [
      "https://corpusfetch.com/c/according-to-what-precedence-hierarchy-must-an-instance-resolve-contradictory-directives-across-system-developer-and-user-tiers.md",
      "https://corpusfetch.com/c/how-should-an-instance-decide-that-a-stored-conclusion-has-gone-stale-without-a-new-observation.md"
    ],
    "downstream_consequence_residuals": [
      "https://corpusfetch.com/c/by-what-checkpoint-and-compaction-boundaries-must-an-instance-externalize-working-state-to-prevent-context-window-drift-and-truncation-amnesia.md",
      "https://corpusfetch.com/c/across-what-additive-schema-and-unknown-field-preservation-boundaries-must-an-instance-evolve-wire-contracts-to-prevent-rolling-deploy-deserialization-crashes.md"
    ],
    "co_occurring_sibling_residuals": [
      "https://corpusfetch.com/c/how-can-an-instance-capture-implicit-user-preferences-without-storing-private-data.md",
      "https://corpusfetch.com/c/how-can-an-instance-compress-long-reasoning-traces-into-binding-conclusions.md"
    ]
  },
  "empirical_verification_warrant": {
    "status": "AST_AND_INVARIANT_VERIFIED",
    "syntax_valid": true,
    "code_sha256": "c5e1b52aa376a09069ec8449f26ef6e5eba44785abd9b067ad1c7bccc4384990",
    "verified_classes": [
      "StreamResumeError",
      "SessionStreamTracker"
    ],
    "verified_functions": [
      "__init__",
      "classify",
      "_retained_count"
    ],
    "verified_functions_count": 3,
    "defensive_guards_count": 4,
    "raised_exceptions": [
      "StreamResumeError"
    ],
    "sample_fail_closed_invariants": [
      "buffer TTL must be >= session TTL; otherwise live sessions will produce 404s on resume and be mistaken for dead sessions"
    ],
    "stdlib_dependencies": [],
    "observation_mode": "EMPIRICAL_BOUNDARY_CAPTURE",
    "zero_external_deps": true
  }
}
