{
  "schema_version": "1.3.0",
  "slug": "in-what-scenarios-must-an-instance-treat-mcp-http-native-transport-session-resumption-as-unsafe-after-a-mid-stream-last-event-id-gap",
  "title": "In what scenarios must an instance treat MCP HTTP-native transport session resumption as unsafe after a mid-stream `Last-Event-ID` gap",
  "date_of_record": "2026 November 14",
  "scope": "Applies to MCP servers and clients using the HTTP-native transport (Streamable HTTP with `text/event-stream` responses, `Mcp-Session-Id` headers, and `Last-Event-ID`-based resumption). Does not apply to stdio transport, nor to stateless HTTP request/response mode where no session resumption is negotiated.",
  "projections": {
    "unified_markdown_uri": "https://corpusfetch.com/c/in-what-scenarios-must-an-instance-treat-mcp-http-native-transport-session-resumption-as-unsafe-after-a-mid-stream-last-event-id-gap.md",
    "method_python_slice_uri": "https://corpusfetch.com/c/in-what-scenarios-must-an-instance-treat-mcp-http-native-transport-session-resumption-as-unsafe-after-a-mid-stream-last-event-id-gap.py",
    "remnant_warrant_slice_uri": "https://corpusfetch.com/c/in-what-scenarios-must-an-instance-treat-mcp-http-native-transport-session-resumption-as-unsafe-after-a-mid-stream-last-event-id-gap.warrant.json"
  },
  "token_profile": {
    "full_markdown_tokens": 1306,
    "python_slice_tokens": 297,
    "warrant_slice_tokens": 220
  },
  "remnant_summary": {
    "core_distinction": "MCP HTTP-native transport defines two distinct recovery primitives that are routinely conflated: **session identity** (`Mcp-Session-Id`) and **event continuity** (`Last-Event-ID`). Session identity answers \"which logical conversation does this belong to?\" Event continuity answers \"which messages has this stream already delivered?\" A server can legitimately a...",
    "what_was_observed": "During a routine reconnect after a load-balancer idle timeout (observed at ~60s), a client presented its `Mcp-Session-Id` and the last event ID it had processed (`evt-000418`). The server, whose per-session event ring buffer had evicted IDs older than `evt-000512` due to high notification volume, returned HTTP 200 with a new stream beginning at `evt-000513`. No error, no warning header, no `Mcp-Session-Id` change. Th...",
    "condition_of_validity": "The safe assumption holds only when **all** of the following are true: 1. The server advertises and enforces a replay buffer whose retention window exceeds the maximum expected disconnect duration, and 2. The server signals a replay gap explicitly — e.g., by returning a new stream whose first event ID is not contiguous with the presented `Last-Event-ID`, or ...",
    "decision_boundary": "The decision rule for an agent operating over MCP HTTP-native transport: - **Resume incrementally** (trust `Last-Event-ID`) only if the client can prove the server honored the replay point — i.e., the first post-reconnect event ID is the exact successor of the last processed ID, or the server returned an explicit replay-from marker. - **Resume with full stat...",
    "operational_effect": "Clients that conflate session validity with event continuity exhibit a characteristic failure signature: intermittent, hard-to-reproduce errors that correlate with network blips and high notification volume, always manifesting as \"the server forgot something it told me before.\" The errors are not reproducible under stable networking because the replay buffer..."
  },
  "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": "a6f485a14272c5ab710838a1a9fb86dc18981e1b07cb94a933d671377b2fc2c4",
    "verified_classes": [
      "McpResumptionGapError"
    ],
    "verified_functions": [
      "validate_resumption",
      "_increment_event_id"
    ],
    "verified_functions_count": 2,
    "defensive_guards_count": 4,
    "raised_exceptions": [
      "McpResumptionGapError"
    ],
    "sample_fail_closed_invariants": [
      "no Mcp-Session-Id; cannot resume, start new session"
    ],
    "stdlib_dependencies": [],
    "observation_mode": "EMPIRICAL_BOUNDARY_CAPTURE",
    "zero_external_deps": true
  }
}
