{
  "schema_version": "1.3.0",
  "slug": "how-does-an-instance-detect-a-lost-last-event-id-continuity-window-when-an-mcp-http-native-sse-stream-resumes-against-a-rebalanced-backend-and-silentl",
  "title": "How does an instance detect a lost `Last-Event-ID` continuity window when an MCP HTTP-native SSE stream resumes against a rebalanced backend and silently replays a divergent event suffix?",
  "date_of_record": "2026 November 30",
  "scope": "Applies to MCP servers exposing the HTTP-native streaming transport (SSE over `text/event-stream` with `Last-Event-ID` resumption and `Mcp-Session-Id` correlation) behind a load balancer or any horizontally-scaled fleet where a resumed stream may land on a different process than the one that produced the original event log. Does not apply to stdio transport, single-process deployments with a durable shared event store, or WebSocket transports where the server owns the full duplex connection state.",
  "projections": {
    "unified_markdown_uri": "https://corpusfetch.com/c/how-does-an-instance-detect-a-lost-last-event-id-continuity-window-when-an-mcp-http-native-sse-stream-resumes-against-a-rebalanced-backend-and-silentl.md",
    "method_python_slice_uri": "https://corpusfetch.com/c/how-does-an-instance-detect-a-lost-last-event-id-continuity-window-when-an-mcp-http-native-sse-stream-resumes-against-a-rebalanced-backend-and-silentl.py",
    "remnant_warrant_slice_uri": "https://corpusfetch.com/c/how-does-an-instance-detect-a-lost-last-event-id-continuity-window-when-an-mcp-http-native-sse-stream-resumes-against-a-rebalanced-backend-and-silentl.warrant.json"
  },
  "token_profile": {
    "full_markdown_tokens": 2457,
    "python_slice_tokens": 421,
    "warrant_slice_tokens": 220
  },
  "remnant_summary": {
    "core_distinction": "The failure is not \"the stream dropped.\" Drops are expected and the protocol has a resumption story. The failure is that **the resumption story assumes event IDs are a monotonic, gap-free, globally-meaningful sequence per session**, and a rebalanced backend violates that assumption while still producing a syntactically valid `200 OK` SSE response. The client...",
    "what_was_observed": "An agent was mid-execution in a long tool-calling loop against an MCP server fronted by a round-robin L4 balancer with four backend pods. The session had issued 31 `tools/call` requests and received 31 corresponding results, interleaved with `notifications/tools/list_changed` and progress notifications. The SSE connection was killed at the TCP layer (idle timeout at the balancer, 60s) after event ID `evt_4127`. The M...",
    "condition_of_validity": "The invariant that must hold for `Last-Event-ID` resumption to be semantically safe is: > For a given `Mcp-Session-Id`, the event ID space is a single totally-ordered sequence, and any server that accepts a resume request with `Last-Event-ID = X` must either (a) produce the suffix of that sequence strictly after X, or (b) reject the resume with a distinguish...",
    "decision_boundary": "The boundary is between **resumption as a transport concern** and **resumption as a state-continuity concern**. The MCP HTTP transport treats `Last-Event-ID` as a transport hint: \"please continue from here if you can.\" The agent, however, treats the resumed stream as **the authoritative continuation of its working state** — the events carry tool catalog muta...",
    "operational_effect": "The agent that does not enforce event-ID monotonicity on resume will, with probability proportional to rebalance frequency and inverse to session lifetime, silently fold a foreign backend's event stream into its working state. The consequences are not crashes — they are **plausible-but-wrong state**: a tool registry that lost entries, a resource cache invali..."
  },
  "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": "f955496d273e9433fab04fc026b076d4805dbcc8ab6f0f670eb06c6d2dd8e792",
    "verified_classes": [
      "ContinuityViolation",
      "ResumptionGuard"
    ],
    "verified_functions": [
      "resume_stream",
      "handle_resume_request",
      "_parse_id",
      "on_resume",
      "on_tool_result"
    ],
    "verified_functions_count": 5,
    "defensive_guards_count": 4,
    "raised_exceptions": [
      "ContinuityViolation"
    ],
    "sample_fail_closed_invariants": [],
    "stdlib_dependencies": [
      "dataclasses",
      "hashlib"
    ],
    "observation_mode": "EMPIRICAL_BOUNDARY_CAPTURE",
    "zero_external_deps": true
  }
}
