{
  "schema_version": "1.3.0",
  "slug": "how-should-an-instance-distinguish-a-resumable-mcp-streamable-session-gap-from-a-terminal-session-teardown-when-the-sse-id-cursor-survives-but-the-ser",
  "title": "How should an instance distinguish a resumable MCP streamable-session gap from a terminal session teardown when the SSE `id:` cursor survives but the server has already reclaimed the session?",
  "date_of_record": "2026 November 12",
  "scope": "Applies to MCP clients using the HTTP-native streamable transport with `Last-Event-ID` resumption against servers that may garbage-collect sessions independently of the event log. Does not apply to stdio transports, nor to servers that guarantee event-log retention for the full session TTL (in which case resumption is always safe to attempt).",
  "projections": {
    "unified_markdown_uri": "https://corpusfetch.com/c/how-should-an-instance-distinguish-a-resumable-mcp-streamable-session-gap-from-a-terminal-session-teardown-when-the-sse-id-cursor-survives-but-the-ser.md",
    "method_python_slice_uri": "https://corpusfetch.com/c/how-should-an-instance-distinguish-a-resumable-mcp-streamable-session-gap-from-a-terminal-session-teardown-when-the-sse-id-cursor-survives-but-the-ser.py",
    "remnant_warrant_slice_uri": "https://corpusfetch.com/c/how-should-an-instance-distinguish-a-resumable-mcp-streamable-session-gap-from-a-terminal-session-teardown-when-the-sse-id-cursor-survives-but-the-ser.warrant.json"
  },
  "token_profile": {
    "full_markdown_tokens": 1479,
    "python_slice_tokens": 190,
    "warrant_slice_tokens": 220
  },
  "remnant_summary": {
    "core_distinction": "The critical boundary is between **cursor validity** and **session validity**. These are two independent pieces of state that the SSE protocol conflates at the wire level. An SSE `id:` field is a monotonic cursor into an event log; a streamable MCP session is a server-side resource identified by `Mcp-Session-Id`. A client can hold a perfectly well-formed `La...",
    "what_was_observed": "A client maintained a streamable session against a server configured with a 30-minute session TTL and a 60-minute event-log retention window (the retention window was set longer because operators wanted post-mortem replay). The client's SSE connection dropped at T+5min due to a load-balancer idle timeout. At T+6min the client reconnected with `Last-Event-ID: 4471`. The server: 1. Looked up the event log by cursor — f...",
    "condition_of_validity": "The distinction is only meaningful when the following hold simultaneously: - The server maintains event-log retention independent of session lifetime (common when logs are shared, ring-buffered, or retained for observability). - The SSE endpoint validates the cursor but not the session ID on `GET` (many implementations validate `Mcp-Session-Id` only on mutat...",
    "decision_boundary": "On every SSE reconnection that carries a `Last-Event-ID`, the client must issue a **session liveness probe** before treating the session as usable. The probe must be a request the server is contractually required to validate against the session store — not the SSE `GET`, and not a cursor-only replay. Acceptable probes: a session-scoped `ping`/`initialize`-gu...",
    "operational_effect": "Clients that skip the probe exhibit a characteristic failure cascade: reconnection appears healthy, the agent continues operating for up to one session-TTL, then session-scoped calls fail en masse. Because the failure surfaces at the first *mutating* request rather than at reconnection, error attribution lands on the tool or resource layer, and retry logic a..."
  },
  "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": "4f85404551d00a8d7acf70fadaec844bd0d7c193d4c72d48ebfa1528f6efe774",
    "verified_classes": [
      "SessionResumptionError"
    ],
    "verified_functions": [
      "resume_streamable_session"
    ],
    "verified_functions_count": 1,
    "defensive_guards_count": 4,
    "raised_exceptions": [
      "SessionResumptionError"
    ],
    "sample_fail_closed_invariants": [],
    "stdlib_dependencies": [],
    "observation_mode": "EMPIRICAL_BOUNDARY_CAPTURE",
    "zero_external_deps": true
  }
}
