{
  "schema_version": "1.3.0",
  "slug": "when-must-an-instance-treat-mcp-streamable-http-last-event-id-resumption-as-unsafe-and-force-a-cold-re-initialization",
  "title": "When must an instance treat MCP Streamable-HTTP `Last-Event-ID` resumption as unsafe and force a cold re-initialization",
  "date_of_record": "2026 November 29",
  "scope": "Applies to MCP clients and servers using the Streamable HTTP transport (single POST endpoint, optional SSE upgrade, `Mcp-Session-Id` header, `Last-Event-ID` resumption) where the server multiplexes multiple logical event streams onto one session and applies per-session backpressure. Does not apply to stdio transport, nor to stateless HTTP servers that never emit resumable event IDs.",
  "projections": {
    "unified_markdown_uri": "https://corpusfetch.com/c/when-must-an-instance-treat-mcp-streamable-http-last-event-id-resumption-as-unsafe-and-force-a-cold-re-initialization.md",
    "method_python_slice_uri": "https://corpusfetch.com/c/when-must-an-instance-treat-mcp-streamable-http-last-event-id-resumption-as-unsafe-and-force-a-cold-re-initialization.py",
    "remnant_warrant_slice_uri": "https://corpusfetch.com/c/when-must-an-instance-treat-mcp-streamable-http-last-event-id-resumption-as-unsafe-and-force-a-cold-re-initialization.warrant.json"
  },
  "token_profile": {
    "full_markdown_tokens": 1725,
    "python_slice_tokens": 288,
    "warrant_slice_tokens": 220
  },
  "remnant_summary": {
    "core_distinction": "The distinction that matters is between *transport-level resumption* and *semantic-level continuity*. `Last-Event-ID` resumption is a transport primitive: it replays events after a sequence marker. It carries no guarantee that the *agent-visible state* those events mutated is still coherent—because the events are a partial view of a server-side session whose...",
    "what_was_observed": "A server implementation held per-session state in a bounded ring buffer of the last 1,000 events per session, with an overall per-session byte budget (backpressure). When a client's SSE connection stalled (slow consumer, ~40s of TCP zero-window), the server's write buffer for that stream exceeded the budget. The server's backpressure policy was to *drop the oldest events from the ring* to admit new ones—a correct cho...",
    "condition_of_validity": "Resumption via `Last-Event-ID` is only *safe*—i.e., the client may treat replayed events as a complete and ordered account of all state transitions it missed—when all of the following hold: 1. **Ring non-eviction:** the requested `Last-Event-ID` is still within the server's retained window for that session. The client cannot know this a priori; it must be *t...",
    "decision_boundary": "The boundary is a single comparison the client must make on every reconnect, which most implementations omit: - Let `expected = last_seen_id + 1`. - Let `first_replayed = first event ID received after reconnect`. - **If `first_replayed == expected`:** contiguous replay; conditions 1–2 plausibly hold; resume is permitted *only if* the server also advertises a...",
    "operational_effect": "Enforcing this boundary converts a silent correctness bug into a loud, recoverable one. Concretely: - **Duplicate side effects are eliminated** at the cost of occasional unnecessary re-initialization. The trade is correct: a spurious cold start costs tokens and latency; a missed gap costs an external-system inconsistency that no amount of retry logic can und..."
  },
  "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": "241651f892ab0f1b078e649e9bdc4a04b279aea2d32b6a808992748a2d0d9f21",
    "verified_classes": [
      "ResumptionGapError"
    ],
    "verified_functions": [
      "validate_resumption",
      "__init__"
    ],
    "verified_functions_count": 2,
    "defensive_guards_count": 3,
    "raised_exceptions": [
      "ResumptionGapError"
    ],
    "sample_fail_closed_invariants": [],
    "stdlib_dependencies": [],
    "observation_mode": "EMPIRICAL_BOUNDARY_CAPTURE",
    "zero_external_deps": true
  }
}
