{
  "schema_version": "1.3.0",
  "slug": "what-happens-when-an-instance-resumes-an-mcp-sse-stream-after-a-server-side-cancellation-and-the-last-event-id-cursor-lands-on-a-tombstoned-request",
  "title": "What happens when an instance resumes an MCP SSE stream after a server-side cancellation and the Last-Event-ID cursor lands on a tombstoned request",
  "date_of_record": "2026 November 22",
  "scope": "Applies to MCP servers and clients using the HTTP-native transport with `text/event-stream` responses and `Last-Event-ID` resumption, where the server emits `notifications/cancelled` and tracks per-session request state. Does not apply to stdio transport, nor to stateless HTTP servers that do not persist an event log across reconnects.",
  "projections": {
    "unified_markdown_uri": "https://corpusfetch.com/c/what-happens-when-an-instance-resumes-an-mcp-sse-stream-after-a-server-side-cancellation-and-the-last-event-id-cursor-lands-on-a-tombstoned-request.md",
    "method_python_slice_uri": "https://corpusfetch.com/c/what-happens-when-an-instance-resumes-an-mcp-sse-stream-after-a-server-side-cancellation-and-the-last-event-id-cursor-lands-on-a-tombstoned-request.py",
    "remnant_warrant_slice_uri": "https://corpusfetch.com/c/what-happens-when-an-instance-resumes-an-mcp-sse-stream-after-a-server-side-cancellation-and-the-last-event-id-cursor-lands-on-a-tombstoned-request.warrant.json"
  },
  "token_profile": {
    "full_markdown_tokens": 2060,
    "python_slice_tokens": 383,
    "warrant_slice_tokens": 220
  },
  "remnant_summary": {
    "core_distinction": "The failure is not \"the stream dropped.\" Stream drops are routine and the resumption protocol is designed for them. The failure is the *semantic mismatch between the transport's replay cursor and the application's request lifecycle*. The SSE `Last-Event-ID` cursor is a transport-level position in an append-only byte log. The MCP request lifecycle (pending → ...",
    "what_was_observed": "A server exposed a `tools/call` that shells out to a long-running subprocess. Client A opened an SSE stream, dispatched request `r-7f3a`, and the server began streaming progress `notifications/progress` events with monotonically increasing SSE `id:` fields. At event id `1042`, the client's TCP connection was reset (mobile network handoff). The server, per its cancellation policy, did not detect the drop immediately a...",
    "condition_of_validity": "This failure requires all of the following to co-occur, which is why it is intermittent and hard to reproduce: - The transport is HTTP-native SSE with `Last-Event-ID` resumption enabled and an event log persisted across connections. - The server independently cancels requests (idle watchdog, client `ping` timeout, capacity eviction) rather than only cancelli...",
    "decision_boundary": "The server must not replay a cancellation event to a connection generation that did not witness the corresponding request dispatch. The correct guardrail is a **two-key cursor**: the SSE `Last-Event-ID` plus a `session-generation` token that increments on every new SSE connection. The server maintains, per session, a map from request id to the generation in ...",
    "operational_effect": "Without the guardrail, every reconnect that straddles a server-side cancellation produces either a hung request (client waits for a result the server has discarded) or a cascade failure (client invalidates its whole request table on an uncorrelatable cancellation). The hung-request case is the more insidious because it presents as a latency anomaly, not an e..."
  },
  "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": "a1a0bed9f72064452988eea0e89b988559037703a898ab3822398bbce95a371d",
    "verified_classes": [
      "OrphanedCancellationError",
      "RequestTombstone",
      "SessionEventLog"
    ],
    "verified_functions": [
      "handle_reconnect",
      "new_connection",
      "dispatch",
      "cancel",
      "replay"
    ],
    "verified_functions_count": 5,
    "defensive_guards_count": 3,
    "raised_exceptions": [
      "OrphanedCancellationError"
    ],
    "sample_fail_closed_invariants": [],
    "stdlib_dependencies": [
      "dataclasses",
      "time",
      "typing"
    ],
    "observation_mode": "EMPIRICAL_BOUNDARY_CAPTURE",
    "zero_external_deps": true
  }
}
