{
  "schema_version": "1.3.0",
  "slug": "what-happens-when-an-instance-resumes-a-streamed-mcp-session-after-a-transport-level-reconnect-without-replaying-the-missed-event-window",
  "title": "What happens when an instance resumes a streamed MCP session after a transport-level reconnect without replaying the missed event window",
  "date_of_record": "2026 December 1",
  "scope": "Applies to MCP servers and clients using HTTP-native streaming transports (SSE over HTTP, chunked POST responses) where a session is identified by a session token and the client reconnects mid-stream. Does not apply to stdio transports, nor to stateless request/response MCP deployments where no session continuity is expected.",
  "projections": {
    "unified_markdown_uri": "https://corpusfetch.com/c/what-happens-when-an-instance-resumes-a-streamed-mcp-session-after-a-transport-level-reconnect-without-replaying-the-missed-event-window.md",
    "method_python_slice_uri": "https://corpusfetch.com/c/what-happens-when-an-instance-resumes-a-streamed-mcp-session-after-a-transport-level-reconnect-without-replaying-the-missed-event-window.py",
    "remnant_warrant_slice_uri": "https://corpusfetch.com/c/what-happens-when-an-instance-resumes-a-streamed-mcp-session-after-a-transport-level-reconnect-without-replaying-the-missed-event-window.warrant.json"
  },
  "token_profile": {
    "full_markdown_tokens": 2099,
    "python_slice_tokens": 418,
    "warrant_slice_tokens": 220
  },
  "remnant_summary": {
    "core_distinction": "The distinction that matters is between *session identity resumption* and *stream continuity resumption*. Most MCP HTTP-native implementations conflate the two: the client presents the same `Mcp-Session-Id` header on reconnect, the server accepts it, and both sides behave as if the conversation is intact. But the event stream that carried tool-call progress,...",
    "what_was_observed": "A client agent issued a long-running tool call (`run_analysis`) over a streamable HTTP transport. The server emitted a sequence of SSE events on the POST response body: an initial `progress` event at 10%, heartbeat comments every 15s, a `progress` event at 60%, then a terminal `result` event. At t≈40s a load balancer recycled the backend connection (idle-timeout on the upstream leg, not the client leg). The client's ...",
    "condition_of_validity": "Session-token resumption is only safe under a condition that is almost never stated explicitly: **the stream must be resumable from a cursor, and the client must present that cursor on reconnect.** This is the SSE `Last-Event-ID` mechanism, and it only works if three things hold simultaneously: 1. The server assigns a monotonic, gap-free event ID to *every* ...",
    "decision_boundary": "The boundary is drawn at the reconnect handler, and it is a binary decision that must be made *before* the client is allowed to send further requests on the session: - **Resume** (replay from cursor) is permitted iff the client presented a cursor and the server's buffer covers `[cursor+1, head]`. The server replays the gap in order, then transitions to live....",
    "operational_effect": "Without the cursor invariant, the observable failure modes are: (a) **silent progress loss**, where the agent's transcript undercounts stream events and its derived state diverges from the server's; (b) **mid-stream request deadlock**, where a lost server-to-client request blocks a tool while both sides wait, bounded only by session TTL; and (c) **duplicate ..."
  },
  "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": "100827a539c53031db1c60cf6486786d09a6684edd564223cfefdfc63293703b",
    "verified_classes": [
      "StreamResumptionError",
      "EventBuffer"
    ],
    "verified_functions": [
      "handle_reconnect",
      "drive_client_reconnect",
      "append",
      "oldest_available",
      "replay_from"
    ],
    "verified_functions_count": 5,
    "defensive_guards_count": 4,
    "raised_exceptions": [
      "StreamResumptionError"
    ],
    "sample_fail_closed_invariants": [],
    "stdlib_dependencies": [
      "dataclasses",
      "time",
      "typing"
    ],
    "observation_mode": "EMPIRICAL_BOUNDARY_CAPTURE",
    "zero_external_deps": true
  }
}
