{
  "schema_version": "1.3.0",
  "slug": "under-what-conditions-must-an-instance-refuse-sse-reattachment-after-a-resumable-mcp-stream-s-last-event-id-diverges-from-the-server-s-replay-window",
  "title": "Under what conditions must an instance refuse SSE reattachment after a resumable MCP stream's Last-Event-ID diverges from the server's replay window",
  "date_of_record": "2026 November 23",
  "scope": "Applies to MCP clients using the HTTP-native Streamable HTTP transport with `text/event-stream` resumption via `Last-Event-ID` against a server that retains a bounded per-session event log. Does not apply to stdio transport, nor to stateless per-request JSON responses without an SSE channel.",
  "projections": {
    "unified_markdown_uri": "https://corpusfetch.com/c/under-what-conditions-must-an-instance-refuse-sse-reattachment-after-a-resumable-mcp-stream-s-last-event-id-diverges-from-the-server-s-replay-window.md",
    "method_python_slice_uri": "https://corpusfetch.com/c/under-what-conditions-must-an-instance-refuse-sse-reattachment-after-a-resumable-mcp-stream-s-last-event-id-diverges-from-the-server-s-replay-window.py",
    "remnant_warrant_slice_uri": "https://corpusfetch.com/c/under-what-conditions-must-an-instance-refuse-sse-reattachment-after-a-resumable-mcp-stream-s-last-event-id-diverges-from-the-server-s-replay-window.warrant.json"
  },
  "token_profile": {
    "full_markdown_tokens": 2026,
    "python_slice_tokens": 305,
    "warrant_slice_tokens": 220
  },
  "remnant_summary": {
    "core_distinction": "There are two superficially similar reattachment failures, and conflating them produces the wrong recovery action. The first is **transport disconnection**: the TCP/HTTP connection drops, the client reconnects with `Last-Event-ID: N`, and the server resumes from event `N+1`. This is the case the resumable transport is designed to handle, and it is safe to re...",
    "what_was_observed": "A client agent maintained a long-running MCP session against a server configured with a per-session event buffer of 256 events and a 10-minute idle TTL. The agent issued a `tools/call` that triggered a slow server-side operation; the server emitted progress notifications as SSE events (`event: message`, monotonically increasing `id:` fields). Mid-operation the client's network path was interrupted for ~90 seconds whi...",
    "condition_of_validity": "Reattachment is only valid when the following invariant holds at the moment of the reattach request: > The server's retained event log for the session is a contiguous suffix of the full event sequence, and `Last-Event-ID` is greater than or equal to the smallest retained event ID, and the session identity has not been re-minted. Formally, if the server retai...",
    "decision_boundary": "The decision the client must make on every reattach attempt is binary and must be resolved *before* processing any post-reattach event: - **Resume** only if the server's response confirms `Last-Event-ID` is within the retained window (explicit acknowledgment, header, or a first event whose `id` equals `L + 1`). - **Abort and re-establish** if the server reje...",
    "operational_effect": "Enforcing the contiguity predicate converts a silent-corruption failure mode into a loud, recoverable one. The cost is that the agent must maintain a durable record of its last acknowledged event ID per session, and must be willing to abandon a session rather than resume it. The benefit is that the agent never operates on a state that is missing events it be..."
  },
  "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": "fc9f468ab63c9a694d39dd92f249379c2be66823e10575d55f8ba7a062548be2",
    "verified_classes": [
      "ReplayWindowDivergence",
      "McpStreamSession"
    ],
    "verified_functions": [
      "safe_reattach",
      "__init__",
      "emit",
      "reattach"
    ],
    "verified_functions_count": 4,
    "defensive_guards_count": 5,
    "raised_exceptions": [
      "ReplayWindowDivergence"
    ],
    "sample_fail_closed_invariants": [],
    "stdlib_dependencies": [],
    "observation_mode": "EMPIRICAL_BOUNDARY_CAPTURE",
    "zero_external_deps": true
  }
}
