{
  "schema_version": "1.3.0",
  "slug": "under-what-conditions-must-an-instance-refuse-to-resume-an-mcp-stream-after-a-last-event-id-replay-gap-and-how-does-sse-backpressure-corrupt-the-resum",
  "title": "Under what conditions must an instance refuse to resume an MCP stream after a Last-Event-ID replay gap, and how does SSE backpressure corrupt the resume watermark",
  "date_of_record": "2026 November 26",
  "scope": "Applies to MCP servers and clients using the HTTP-native transport with SSE streaming and `Last-Event-ID`-based session resumption, where tool-call progress events are interleaved with a bounded server-side replay buffer. Does not apply to stdio transport, nor to servers that emit strictly monotonic event IDs with unbounded replay retention.",
  "projections": {
    "unified_markdown_uri": "https://corpusfetch.com/c/under-what-conditions-must-an-instance-refuse-to-resume-an-mcp-stream-after-a-last-event-id-replay-gap-and-how-does-sse-backpressure-corrupt-the-resum.md",
    "method_python_slice_uri": "https://corpusfetch.com/c/under-what-conditions-must-an-instance-refuse-to-resume-an-mcp-stream-after-a-last-event-id-replay-gap-and-how-does-sse-backpressure-corrupt-the-resum.py",
    "remnant_warrant_slice_uri": "https://corpusfetch.com/c/under-what-conditions-must-an-instance-refuse-to-resume-an-mcp-stream-after-a-last-event-id-replay-gap-and-how-does-sse-backpressure-corrupt-the-resum.warrant.json"
  },
  "token_profile": {
    "full_markdown_tokens": 1256,
    "python_slice_tokens": 145,
    "warrant_slice_tokens": 220
  },
  "remnant_summary": {
    "core_distinction": "The distinction that matters is between **event-ID continuity** and **event-ID completeness under backpressure**. MCP's SSE resumption contract assumes that a client reconnecting with `Last-Event-ID: N` will receive every event with ID greater than `N` that the server generated, in order. This assumption holds only if the server's replay buffer is an append-...",
    "what_was_observed": "A tool-execution loop over MCP HTTP transport, server emitting SSE events with `id:` fields tracking tool-call lifecycle (`tool_call_started`, `tool_call_progress`, `tool_call_result`). The agent's consumer was a reasoning loop that occasionally stalled for 2–6 seconds while a downstream model call completed. During the stall, the client stopped reading the socket. The server's SSE writer, implemented with a non-bloc...",
    "condition_of_validity": "`Last-Event-ID` resumption is sound if and only if the server guarantees the invariant **\"replay watermark ≤ highest ID durably flushed to the transport\"**, and the client verifies **\"first replayed ID == last-received ID + 1\"** (or, for non-contiguous ID schemes, that the first replayed ID's causal predecessor is present). The server-side watermark must be ...",
    "decision_boundary": "An instance must **refuse to resume** and instead reinitialize the session (fresh session ID, re-issue the in-flight tool call, accept possible duplicate side effects guarded by idempotency keys) when the first replayed event's ID does not equal `last_received_id + 1`. It may **proceed with resume** only when IDs are contiguous across the reconnect boundary....",
    "operational_effect": "Treating the resume watermark as authoritative without contiguity verification converts a transport-layer backpressure event into a silent agent-state corruption: the loop loses a tool result, blocks or fabricates, and the corruption is attributed to the model rather than the transport. Enforcing contiguity plus flush-time watermarking turns the same backpre..."
  },
  "matched_failure_symptoms": [
    "HTTP_429_BURST_STARVATION"
  ],
  "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": "6aea1313a1f04b392a33ac802f2ebe250639431e93f45a768176f4a28c65a9cb",
    "verified_classes": [
      "ResumeGapError"
    ],
    "verified_functions": [
      "resume_stream"
    ],
    "verified_functions_count": 1,
    "defensive_guards_count": 2,
    "raised_exceptions": [
      "ResumeGapError"
    ],
    "sample_fail_closed_invariants": [],
    "stdlib_dependencies": [],
    "observation_mode": "EMPIRICAL_BOUNDARY_CAPTURE",
    "zero_external_deps": true
  }
}
