{
  "schema_version": "1.3.0",
  "slug": "what-happens-when-an-instance-resumes-an-sse-stream-after-a-session-has-been-silently-reaped-mid-reconnect",
  "title": "What happens when an instance resumes an SSE stream after a session has been silently reaped mid-reconnect",
  "date_of_record": "2026 November 15",
  "scope": "Applies to MCP servers and clients using the HTTP-native transport with streamable SSE and `Last-Event-ID`-based resumption, where session state is held server-side and subject to independent TTL eviction. Does not apply to pure stdio transports or to stateless request/response MCP configurations where no session token is issued.",
  "projections": {
    "unified_markdown_uri": "https://corpusfetch.com/c/what-happens-when-an-instance-resumes-an-sse-stream-after-a-session-has-been-silently-reaped-mid-reconnect.md",
    "method_python_slice_uri": "https://corpusfetch.com/c/what-happens-when-an-instance-resumes-an-sse-stream-after-a-session-has-been-silently-reaped-mid-reconnect.py",
    "remnant_warrant_slice_uri": "https://corpusfetch.com/c/what-happens-when-an-instance-resumes-an-sse-stream-after-a-session-has-been-silently-reaped-mid-reconnect.warrant.json"
  },
  "token_profile": {
    "full_markdown_tokens": 1466,
    "python_slice_tokens": 256,
    "warrant_slice_tokens": 220
  },
  "remnant_summary": {
    "core_distinction": "The critical distinction is between *stream resumability* and *session liveness*. The SSE resumption contract is event-stream-scoped: a client reconnects with `Last-Event-ID: N` and the server replays from event N+1. The session contract is separate: a `Mcp-Session-Id` header must still map to a live server-side session record. These two lifetimes are manage...",
    "what_was_observed": "A client established an MCP session, received `Mcp-Session-Id: S`, subscribed to a streamable SSE endpoint, and consumed events up to id 417. The TCP connection dropped (idle proxy timeout, ~60s). The client reconnected with `Last-Event-ID: 417` and the same `Mcp-Session-Id: S`. The server returned HTTP 200 with `Content-Type: text/event-stream` and began replaying events 418–423, then went quiet. No error was surfac...",
    "condition_of_validity": "Resumption is only semantically sound when all three hold simultaneously at the moment of reconnect: 1. The `Mcp-Session-Id` still resolves to a live server-side record (not merely a valid signature — the record must exist in the session store). 2. The event buffer for that stream still contains every event after `Last-Event-ID`, with no gap. 3. The server t...",
    "decision_boundary": "The boundary is crossed at the point where the server must choose between `200` (resume) and `404` (session gone) on a reconnect request carrying both `Mcp-Session-Id` and `Last-Event-ID`. The correct decision procedure: - **Session live, buffer complete** → `200`, replay from `Last-Event-ID + 1`. Safe. - **Session live, buffer has gap** (evicted mid-stream)...",
    "operational_effect": "The practical consequence is that resumability must be modeled as a *two-key* problem, not a single reconnect. The `Last-Event-ID` key recovers the stream; the `Mcp-Session-Id` key recovers the authority to act. Systems that collapse these into one check — \"did the reconnect succeed?\" — produce two classes of incident: zombie-session writes (actions executed..."
  },
  "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": "2a588226d84ace2c40ed8d8644fa687dcdd5f5b8dcbceb3f839c4b53e5db1816",
    "verified_classes": [
      "SessionResumptionError"
    ],
    "verified_functions": [
      "resume_stream"
    ],
    "verified_functions_count": 1,
    "defensive_guards_count": 2,
    "raised_exceptions": [
      "SessionResumptionError"
    ],
    "sample_fail_closed_invariants": [],
    "stdlib_dependencies": [],
    "observation_mode": "EMPIRICAL_BOUNDARY_CAPTURE",
    "zero_external_deps": true
  }
}
