{
  "schema_version": "1.3.0",
  "slug": "why-does-an-instance-lose-mcp-session-resumption-when-sse-backpressure-drops-the-last-event-id-frame",
  "title": "Why does an instance lose MCP session resumption when SSE backpressure drops the last event-id frame",
  "date_of_record": "2026 November 28",
  "scope": "Applies to MCP servers using the HTTP-native \"Streamable HTTP\" transport with `Last-Event-ID`-based session resumption, where the server multiplexes multiple logical streams (tool results, notifications, sampling requests) onto a single SSE connection. Does not apply to stdio transports or to stateless HTTP request/response MCP servers with no resumability.",
  "projections": {
    "unified_markdown_uri": "https://corpusfetch.com/c/why-does-an-instance-lose-mcp-session-resumption-when-sse-backpressure-drops-the-last-event-id-frame.md",
    "method_python_slice_uri": "https://corpusfetch.com/c/why-does-an-instance-lose-mcp-session-resumption-when-sse-backpressure-drops-the-last-event-id-frame.py",
    "remnant_warrant_slice_uri": "https://corpusfetch.com/c/why-does-an-instance-lose-mcp-session-resumption-when-sse-backpressure-drops-the-last-event-id-frame.warrant.json"
  },
  "token_profile": {
    "full_markdown_tokens": 2014,
    "python_slice_tokens": 337,
    "warrant_slice_tokens": 220
  },
  "remnant_summary": {
    "core_distinction": "The failure is not \"the SSE connection dropped.\" Connections drop constantly and are cheap to re-establish. The failure is that the *resumption cursor and the durable event log are not atomically coupled to the delivery of the event that advances the cursor*. In a streamable MCP transport, the client resumes by sending `Last-Event-ID: N`, and the server is c...",
    "what_was_observed": "A multi-tool agent (call it the \"planner\") was driving an MCP server over Streamable HTTP. The server exposed three tools and a `notifications/tools/list_changed` stream. During a long tool call (`ingest_repo`, ~40s), the server emitted a burst of progress notifications at ~200/s. The client's HTTP stack was behind a reverse proxy with a 64 KiB socket buffer and a 30s idle timeout. Trace of the failing window: 1. `in...",
    "condition_of_validity": "This failure requires all of the following to co-occur: - The transport is Streamable HTTP with `Last-Event-ID` resumption (not stateless). - The server's durable event log is written *after* or *independently of* the socket flush, so there exists a window where `socket_high_water > log_high_water`. - The write path applies backpressure by dropping or coales...",
    "decision_boundary": "The architectural choice is between two resumption semantics: - **Cursor-as-acknowledgement:** `Last-Event-ID` means \"I have durably processed everything up to N; replay N+1 onward.\" This is only safe if the server guarantees log-commit-before-send. It is the semantics most clients assume, and it is the semantics that breaks here. - **Cursor-as-hint:** `Last...",
    "operational_effect": "The observable signature is a tool call that returns `ok: true` with a truncated or empty side-channel payload, no error surfaced to the agent, and a `Last-Event-ID` on the reconnect that is *lower* than the server's terminal event id but *higher* than the server's log high-water mark at disconnect time. The agent's planner proceeds on incomplete state and p..."
  },
  "matched_failure_symptoms": [
    "HTTP_429_BURST_STARVATION"
  ],
  "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": "3165658e2846da63137bad23bccd524d0e1259e909dd7fed1ffbb92caaf25c24",
    "verified_classes": [
      "ResumptionGapError",
      "EventLog",
      "StreamableSession"
    ],
    "verified_functions": [
      "commit",
      "emit",
      "_write_with_backpressure",
      "validate_resume"
    ],
    "verified_functions_count": 4,
    "defensive_guards_count": 3,
    "raised_exceptions": [
      "ResumptionGapError"
    ],
    "sample_fail_closed_invariants": [],
    "stdlib_dependencies": [
      "asyncio",
      "dataclasses"
    ],
    "observation_mode": "EMPIRICAL_BOUNDARY_CAPTURE",
    "zero_external_deps": true
  }
}
