{
  "schema_version": "1.3.0",
  "slug": "how-does-an-instance-detect-that-an-mcp-streamable-http-session-has-silently-forked-the-resumability-last-event-id-divergence-invariant",
  "title": "How does an instance detect that an MCP Streamable HTTP session has silently forked: the resumability/`Last-Event-ID` divergence invariant",
  "date_of_record": "2026 November 22",
  "scope": "Applies to MCP servers using the Streamable HTTP transport with `GET` SSE resumption (`Last-Event-ID`) and per-session event IDs, and to clients/agents that reconnect mid-tool-call. Does not apply to stdio transport, nor to stateless HTTP servers that never emit event IDs or never advertise resumability.",
  "projections": {
    "unified_markdown_uri": "https://corpusfetch.com/c/how-does-an-instance-detect-that-an-mcp-streamable-http-session-has-silently-forked-the-resumability-last-event-id-divergence-invariant.md",
    "method_python_slice_uri": "https://corpusfetch.com/c/how-does-an-instance-detect-that-an-mcp-streamable-http-session-has-silently-forked-the-resumability-last-event-id-divergence-invariant.py",
    "remnant_warrant_slice_uri": "https://corpusfetch.com/c/how-does-an-instance-detect-that-an-mcp-streamable-http-session-has-silently-forked-the-resumability-last-event-id-divergence-invariant.warrant.json"
  },
  "token_profile": {
    "full_markdown_tokens": 1748,
    "python_slice_tokens": 329,
    "warrant_slice_tokens": 220
  },
  "remnant_summary": {
    "core_distinction": "The failure is not \"the stream dropped.\" A dropped stream is observable: the TCP/HTTP layer raises, the client sees EOF, and reconnect logic fires. The failure that matters is a *silent fork*: the client reconnects with a `Last-Event-ID` that the server accepts, resumes the SSE stream, and continues receiving events — but those events belong to a *different*...",
    "what_was_observed": "A tool-calling agent held a session `S` with an MCP server. It issued a `tools/call` for a long-running operation (`deploy_migration`). The server streamed progress events `id: 41, 42, 43` over the `GET` SSE channel, then the connection was severed by an intermediate proxy idle-timeout (common at 60s for SSE behind load balancers). The agent's transport layer reconnected with `Last-Event-ID: 43`. The server had, in t...",
    "condition_of_validity": "The invariant that must hold for resumption to be *safe* (as opposed to merely *lossless*) is: > For any reconnect with `Last-Event-ID: N`, the server must resume a session whose *payload-level execution identity* (run ID, tool-call ID, or equivalent continuity token) is identical to the one that produced event N. This invariant is **not** part of the MCP tr...",
    "decision_boundary": "The agent must decide, at reconnect time, between two behaviors. The boundary is the continuity-token comparison: - **Token matches** → resume transparently; the in-flight reasoning trace remains valid; continue folding events into context. - **Token absent** → the server does not support continuity assertions. The agent must *downgrade* its confidence: trea...",
    "operational_effect": "The operational consequence is that MCP session resumption must be modeled as a *two-layer* protocol: a transport layer that guarantees event delivery from cursor N, and a session layer that guarantees execution identity across the cursor boundary. The transport layer is specified; the session layer is not, and must be reconstructed by the client from payloa..."
  },
  "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": "d970831e0bede0d4635233d21220214546d8478eb9b15d961f097096298f0273",
    "verified_classes": [
      "SessionForkError",
      "Event"
    ],
    "verified_functions": [
      "resume_session",
      "handle_reconnect"
    ],
    "verified_functions_count": 2,
    "defensive_guards_count": 3,
    "raised_exceptions": [
      "SessionForkError"
    ],
    "sample_fail_closed_invariants": [],
    "stdlib_dependencies": [
      "dataclasses",
      "json"
    ],
    "observation_mode": "EMPIRICAL_BOUNDARY_CAPTURE",
    "zero_external_deps": true
  }
}
