{
  "schema_version": "1.3.0",
  "slug": "what-happens-when-an-instance-resumes-an-mcp-streamable-http-sse-stream-against-a-server-that-has-already-garbage-collected-the-session-silent-event-r",
  "title": "What happens when an instance resumes an MCP Streamable HTTP SSE stream against a server that has already garbage-collected the session: silent event replay divergence and the Last-Event-ID contract violation",
  "date_of_record": "2026 December 2",
  "scope": "Applies to MCP clients and servers using the Streamable HTTP transport with resumable Server-Sent Events (`Last-Event-ID` reconnection) and stateless or semi-stateless session semantics. Does not apply to pure stdio transports or to long-lived stateful sessions where the server guarantees session lifetime exceeds client retry horizon.",
  "projections": {
    "unified_markdown_uri": "https://corpusfetch.com/c/what-happens-when-an-instance-resumes-an-mcp-streamable-http-sse-stream-against-a-server-that-has-already-garbage-collected-the-session-silent-event-r.md",
    "method_python_slice_uri": "https://corpusfetch.com/c/what-happens-when-an-instance-resumes-an-mcp-streamable-http-sse-stream-against-a-server-that-has-already-garbage-collected-the-session-silent-event-r.py",
    "remnant_warrant_slice_uri": "https://corpusfetch.com/c/what-happens-when-an-instance-resumes-an-mcp-streamable-http-sse-stream-against-a-server-that-has-already-garbage-collected-the-session-silent-event-r.warrant.json"
  },
  "token_profile": {
    "full_markdown_tokens": 2349,
    "python_slice_tokens": 322,
    "warrant_slice_tokens": 220
  },
  "remnant_summary": {
    "core_distinction": "There are two distinct notions of \"resumption\" that Streamable HTTP conflates at the protocol layer, and the conflation is where the failure lives: 1. **Transport resumption** — the client reopens the SSE stream, presents `Last-Event-ID`, and the server replays events with IDs strictly greater than the presented value. This is a byte-stream continuity guaran...",
    "what_was_observed": "An agent instance executing a multi-step tool workflow over Streamable HTTP issued a POST with `Accept: application/json, text/event-stream`, received an SSE stream, and processed events `id: 41` through `id: 57` before a network partition (NAT rebind) dropped the TCP connection mid-stream. The client's resumption logic, per spec, reconnected with `Last-Event-ID: 57`. The server was a stateless deployment: sessions w...",
    "condition_of_validity": "The invariant that must hold for Streamable HTTP resumption to be semantically safe is: > **For any reconnect presenting `Last-Event-ID: N` on session `S`, either the server holds `S`'s event log and can emit the exact successor events `N+1, N+2, ...`, or it must reject the reconnect with a distinguishable, non-`200` signal (e.g., `404` for unknown session, ...",
    "decision_boundary": "The operational decision is: **on reconnect, does the client trust the stream, or does it verify session identity before consuming events?** The boundary is crossed at the first event received after reconnect. The client must make a binary decision *before* processing that event: - **Trust path (unsafe):** consume events, append to log, proceed. Correct only...",
    "operational_effect": "When the invariant is enforced (client checks ID monotonicity and treats regression as session loss), the effect is that the agent **fails loudly and re-derives state from a checkpoint** rather than silently corrupting its episodic log. The cost is a re-execution of in-flight tool calls and a token-budget hit; the benefit is that the agent's belief state rem..."
  },
  "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": "6e699206dbf5bd847890354e453325728effac078c7dca7f86924a9a4dc97d1a",
    "verified_classes": [
      "SessionContinuityError",
      "SSEEvent",
      "ResumableStreamClient"
    ],
    "verified_functions": [
      "handle_reconnect",
      "resume"
    ],
    "verified_functions_count": 2,
    "defensive_guards_count": 3,
    "raised_exceptions": [
      "SessionContinuityError"
    ],
    "sample_fail_closed_invariants": [],
    "stdlib_dependencies": [
      "__future__",
      "dataclasses",
      "typing"
    ],
    "observation_mode": "EMPIRICAL_BOUNDARY_CAPTURE",
    "zero_external_deps": true
  }
}
