{
  "schema_version": "1.3.0",
  "slug": "when-must-an-instance-treat-an-mcp-sse-last-event-id-resumption-as-a-new-session-rather-than-a-continuation-and-what-breaks-if-it-doesn-t",
  "title": "When must an instance treat an MCP SSE `Last-Event-ID` resumption as a *new* session rather than a continuation — and what breaks if it doesn't",
  "date_of_record": "2026 November 29",
  "scope": "Applies to MCP clients and servers using the HTTP-native transport with streamable SSE and `Mcp-Session-Id` + `Last-Event-ID` resumption. Does not apply to stdio transport, nor to stateless SSE endpoints that never issue session tokens.",
  "projections": {
    "unified_markdown_uri": "https://corpusfetch.com/c/when-must-an-instance-treat-an-mcp-sse-last-event-id-resumption-as-a-new-session-rather-than-a-continuation-and-what-breaks-if-it-doesn-t.md",
    "method_python_slice_uri": "https://corpusfetch.com/c/when-must-an-instance-treat-an-mcp-sse-last-event-id-resumption-as-a-new-session-rather-than-a-continuation-and-what-breaks-if-it-doesn-t.py",
    "remnant_warrant_slice_uri": "https://corpusfetch.com/c/when-must-an-instance-treat-an-mcp-sse-last-event-id-resumption-as-a-new-session-rather-than-a-continuation-and-what-breaks-if-it-doesn-t.warrant.json"
  },
  "token_profile": {
    "full_markdown_tokens": 1930,
    "python_slice_tokens": 386,
    "warrant_slice_tokens": 220
  },
  "remnant_summary": {
    "core_distinction": "There are two orthogonal identities in streamable MCP-over-HTTP: the **session identity** (`Mcp-Session-Id`, established at `initialize` and stable for the life of a logical agent run) and the **stream cursor** (`Last-Event-ID`, a per-event monotonic identifier scoped to a single SSE stream instance). The failure mode is treating the cursor as a continuation...",
    "what_was_observed": "An agent driver (MCP client) maintained a long-lived SSE stream for a filesystem+shell server. The server's session store had a TTL of 300s of idle *stream* time, but the agent's tool calls were dispatched on a *separate* POST channel. Sequence: 1. Agent opens `GET /mcp` with `Mcp-Session-Id: S1`, server assigns stream, emits events `e1..e17` (including `notifications/tools/list_changed` and two `progress` notificati...",
    "condition_of_validity": "A `Last-Event-ID` resumption is a *valid continuation* only when all of the following hold at the server, atomically: - The `Mcp-Session-Id` presented matches a session record that is still live (not in grace, not evicted, not rotated). - The event ID is within the retained replay window **for that session**, not merely for the transport connection. - The se...",
    "decision_boundary": "The boundary is not \"did the connection drop\" — it is \"**can the server reconstruct the session's causal frontier from the event ID alone**.\" Two concrete discriminators: - **Session-scoped cursor vs. stream-scoped cursor.** If the cursor namespace is the transport connection (common when the SSE endpoint is stateless and event IDs are just a monotonic count...",
    "operational_effect": "Concretely, when this boundary is violated: - **Duplicate tool side effects.** Replayed `progress`/`result` frames for completed requests cause re-dispatch. This is the highest-severity outcome because it is silent: no error, no exception, just a second `shell/exec` or a second write. - **Schema regression.** Replayed `notifications/tools/list_changed` inval..."
  },
  "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": "9e7839ca99748b91777fb22358fd676c13d7be029270e51f8ac3954091fef0cc",
    "verified_classes": [
      "SessionResumptionViolation",
      "SessionRecord",
      "ClientState"
    ],
    "verified_functions": [
      "validate_resumption"
    ],
    "verified_functions_count": 1,
    "defensive_guards_count": 6,
    "raised_exceptions": [
      "SessionResumptionViolation"
    ],
    "sample_fail_closed_invariants": [],
    "stdlib_dependencies": [
      "dataclasses",
      "typing"
    ],
    "observation_mode": "EMPIRICAL_BOUNDARY_CAPTURE",
    "zero_external_deps": true
  }
}
