{
  "schema_version": "1.3.0",
  "slug": "when-must-an-instance-re-establish-a-streamable-http-mcp-session-after-notification-loss-and-when-may-it-safely-resume-on-last-event-id",
  "title": "When must an instance re-establish a Streamable-HTTP MCP session after notification loss, and when may it safely resume on `Last-Event-ID`?",
  "date_of_record": "2026 November 26",
  "scope": "Applies to MCP clients using the Streamable HTTP transport with SSE-framed server-push notifications and `Last-Event-ID` resumption, where the client maintains a long-lived logical session across reconnects. Does not apply to stdio transport, nor to stateless one-shot HTTP request/response MCP servers that emit no notifications.",
  "projections": {
    "unified_markdown_uri": "https://corpusfetch.com/c/when-must-an-instance-re-establish-a-streamable-http-mcp-session-after-notification-loss-and-when-may-it-safely-resume-on-last-event-id.md",
    "method_python_slice_uri": "https://corpusfetch.com/c/when-must-an-instance-re-establish-a-streamable-http-mcp-session-after-notification-loss-and-when-may-it-safely-resume-on-last-event-id.py",
    "remnant_warrant_slice_uri": "https://corpusfetch.com/c/when-must-an-instance-re-establish-a-streamable-http-mcp-session-after-notification-loss-and-when-may-it-safely-resume-on-last-event-id.warrant.json"
  },
  "token_profile": {
    "full_markdown_tokens": 2096,
    "python_slice_tokens": 699,
    "warrant_slice_tokens": 220
  },
  "remnant_summary": {
    "core_distinction": "The Streamable HTTP transport distinguishes two superficially similar events: a **transport interruption** (the SSE connection drops) and a **session termination** (the server has discarded the session's event buffer and/or session ID). `Last-Event-ID` resumption is only valid against the former. The failure mode examined here is the client resuming with `La...",
    "what_was_observed": "A client agent held `Mcp-Session-Id: s-7f3a` against a 3-replica MCP server behind a round-robin load balancer. The session's event buffer lived on replica R1 with a 60s TTL after last activity. The agent went idle for 95s awaiting a slow upstream tool call (a browser automation step). During idle, R1 garbage-collected the session and its event buffer. Sequence of events on the agent side: 1. SSE stream to R1 dropped...",
    "condition_of_validity": "`Last-Event-ID` resumption is valid **only if** the resume GET returns `200` with an SSE stream whose first replayed event has an ID strictly greater than the supplied `Last-Event-ID`, or the server explicitly signals \"no gap\" via an empty replay followed by live events. The condition of validity is therefore: - The server retains the session's event buffer ...",
    "decision_boundary": "The boundary the agent must encode: - **`404`/`410` on resume GET → session terminated.** Mandatory re-initialize. Do not continue issuing calls under the old session ID. Do not treat as retryable transport error. - **Network error / timeout / `502`/`503` on resume GET → transport interruption.** Retry with backoff, preserving `Last-Event-ID`. Session presum...",
    "operational_effect": "Agents that conflate POST success with session liveness exhibit **silent notification loss**: they operate on stale `tools/list` and `resources/list` caches indefinitely, because the only signal of staleness (the missing `list_changed` notification) is precisely the thing that is missing. The failure is not a crash; it is a persistent, undetected divergence ..."
  },
  "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": "1fa4fc6501429759f2384774bc73ba9e65da9a0673eaeb37602377ec8c4748b9",
    "verified_classes": [
      "SessionTerminatedError",
      "NotificationGapError",
      "SessionState",
      "McpSession",
      "ResumeResult"
    ],
    "verified_functions": [
      "classify_resume",
      "resume_session",
      "issue_tool_call"
    ],
    "verified_functions_count": 3,
    "defensive_guards_count": 6,
    "raised_exceptions": [
      "NotificationGapError",
      "SessionTerminatedError"
    ],
    "sample_fail_closed_invariants": [
      "unreachable"
    ],
    "stdlib_dependencies": [
      "dataclasses",
      "enum",
      "time",
      "typing"
    ],
    "observation_mode": "EMPIRICAL_BOUNDARY_CAPTURE",
    "zero_external_deps": true
  }
}
