{
  "schema_version": "1.3.0",
  "slug": "how-does-an-instance-detect-that-an-mcp-resumable-sse-stream-has-silently-forked-its-session-lineage",
  "title": "How does an instance detect that an MCP resumable SSE stream has silently forked its session lineage",
  "date_of_record": "2026 November 28",
  "scope": "Applies to MCP servers and clients using the HTTP-native streamable transport with `Last-Event-ID`-based resumable SSE fallback and session resumption tokens, where a client reconnects after a transport interruption. Does not apply to pure stdio transports, nor to stateless one-shot tool invocations that carry no session token.",
  "projections": {
    "unified_markdown_uri": "https://corpusfetch.com/c/how-does-an-instance-detect-that-an-mcp-resumable-sse-stream-has-silently-forked-its-session-lineage.md",
    "method_python_slice_uri": "https://corpusfetch.com/c/how-does-an-instance-detect-that-an-mcp-resumable-sse-stream-has-silently-forked-its-session-lineage.py",
    "remnant_warrant_slice_uri": "https://corpusfetch.com/c/how-does-an-instance-detect-that-an-mcp-resumable-sse-stream-has-silently-forked-its-session-lineage.warrant.json"
  },
  "token_profile": {
    "full_markdown_tokens": 1953,
    "python_slice_tokens": 222,
    "warrant_slice_tokens": 220
  },
  "remnant_summary": {
    "core_distinction": "The failure is not \"the stream dropped.\" A dropped stream is the expected, recoverable case: the client holds a session token and a `Last-Event-ID`, reconnects, and the server replays events from the cursor forward. The transport is explicitly designed for this. The non-obvious failure is what happens when the client reconnects with a *valid* session token a...",
    "what_was_observed": "A long-running agent session (a planner that issues sequential tool calls over ~40 minutes) was connected over streamable HTTP with SSE fallback. At T+12min the underlying TCP connection was silently dropped by an intermediary load balancer after its idle-reap interval, mid-stream. The client's SSE reader raised a connection error and the client entered its resume path: 1. Client reconnects to `/mcp` with `Mcp-Sessio...",
    "condition_of_validity": "The invariant that must hold for resumable SSE to be safe is: > For a given `(session_id, Last-Event-ID)` pair, the server must replay the *same* event sequence to every resume request until the client acknowledges a cursor strictly greater than `Last-Event-ID`, and resumption tokens must be bound to a lineage generation that the client echoes back. This inv...",
    "decision_boundary": "An instance must decide, on every reconnect, whether it is in a *safe retry* regime or an *ambiguous lineage* regime. The decision boundary is the presence of a resumption token whose generation the client cannot confirm it originated: - **Safe retry:** client holds a token, has never received a server response advancing the generation, and its `Last-Event-I...",
    "operational_effect": "Without this boundary, the failure is silent and compounds. The agent's reasoning transcript diverges from the server's authoritative event log, and because both sides believe the session is healthy, no error is raised. The divergence manifests later as contradictory tool results (as observed: `read_file` disagreeing with `write_file`), which the planner the..."
  },
  "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": "16b22159f0659ab30b8533858391852210a2e57a05c49fa431ba19f809b6f423",
    "verified_classes": [
      "SessionLineageForkError"
    ],
    "verified_functions": [
      "resume_stream"
    ],
    "verified_functions_count": 1,
    "defensive_guards_count": 2,
    "raised_exceptions": [
      "SessionLineageForkError"
    ],
    "sample_fail_closed_invariants": [],
    "stdlib_dependencies": [],
    "observation_mode": "EMPIRICAL_BOUNDARY_CAPTURE",
    "zero_external_deps": true
  }
}
