{
  "schema_version": "1.3.0",
  "slug": "what-happens-when-an-instance-resumes-an-mcp-streamable-http-sse-stream-after-the-server-has-already-reaped-the-session",
  "title": "What happens when an instance resumes an MCP streamable-HTTP SSE stream after the server has already reaped the session",
  "date_of_record": "2026 November 28",
  "scope": "Applies to MCP clients using the HTTP-native streamable transport with `Last-Event-ID` resumable SSE fallback, where the server maintains per-session event replay buffers with independent TTLs. Does not apply to stdio transport or to stateless HTTP transports without session resumption.",
  "projections": {
    "unified_markdown_uri": "https://corpusfetch.com/c/what-happens-when-an-instance-resumes-an-mcp-streamable-http-sse-stream-after-the-server-has-already-reaped-the-session.md",
    "method_python_slice_uri": "https://corpusfetch.com/c/what-happens-when-an-instance-resumes-an-mcp-streamable-http-sse-stream-after-the-server-has-already-reaped-the-session.py",
    "remnant_warrant_slice_uri": "https://corpusfetch.com/c/what-happens-when-an-instance-resumes-an-mcp-streamable-http-sse-stream-after-the-server-has-already-reaped-the-session.warrant.json"
  },
  "token_profile": {
    "full_markdown_tokens": 1900,
    "python_slice_tokens": 411,
    "warrant_slice_tokens": 220
  },
  "remnant_summary": {
    "core_distinction": "There are two distinct notions of \"the stream is still alive\" in MCP's streamable HTTP transport, and they can silently diverge. The **transport-level liveness** is whether the TCP connection and SSE framing are intact — the client can still receive bytes. The **session-level liveness** is whether the server still holds the session's replay buffer and event-...",
    "what_was_observed": "A long-running tool-call orchestration agent (call it the *consumer*) was connected to an MCP server exposing a `run_job` tool that streams progress events over SSE. The consumer tracked the last received `id:` field and, on any disconnect, reconnected with `Last-Event-ID: <last_seen>`. Sequence observed: 1. Consumer received events `id=1001` through `id=1047`, then the network dropped. The consumer had processed thr...",
    "condition_of_validity": "The resumption protocol is only correct under the following conjunction, which the transport specification does **not** guarantee: - **Session TTL ≥ client's maximum reconnect horizon.** If the server reaps the session before the client's longest backoff interval elapses, resumption is unsound. - **Event-ID namespace is monotonic across the session lifetime ...",
    "decision_boundary": "The decision the client must make on every reconnect is: *is this a resumption of my session, or a new session masquerading as one?* The boundary is defined by the first event ID received after reconnect: - If `first_id == last_seen + 1`: true resumption, no gap, proceed. - If `first_id > last_seen + 1`: **gap detected** — the server skipped events. This is ...",
    "operational_effect": "Without a session-reset-aware resumption guard, the observable failure modes are: - **Silent event loss** on session reap (the observed case): the consumer's state diverges from the server's authoritative state with no error surfaced, and downstream tool calls operate on stale derived state. - **Ordering corruption** when the counter restart is accepted as v..."
  },
  "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": "037e654d38f36c2f13a51a362118ca43237016a255a8031d763adcc480ac0305",
    "verified_classes": [
      "SessionResumptionError",
      "ReconnectContext"
    ],
    "verified_functions": [
      "validate_resumption",
      "resume_stream"
    ],
    "verified_functions_count": 2,
    "defensive_guards_count": 4,
    "raised_exceptions": [
      "SessionResumptionError"
    ],
    "sample_fail_closed_invariants": [
      "session reset with no authoritative status available; cannot safely resume"
    ],
    "stdlib_dependencies": [
      "dataclasses",
      "time",
      "typing"
    ],
    "observation_mode": "EMPIRICAL_BOUNDARY_CAPTURE",
    "zero_external_deps": true
  }
}
