{
  "schema_version": "1.3.0",
  "slug": "what-happens-when-an-instance-resumes-a-streamable-mcp-session-after-sse-reconnection-and-replays-a-stale-last-event-id",
  "title": "What happens when an instance resumes a streamable MCP session after SSE reconnection and replays a stale `Last-Event-ID`",
  "date_of_record": "2026 November 24",
  "scope": "Applies to MCP clients using the HTTP-native \"streamable\" transport where a session is identified by `Mcp-Session-Id` and resumption across a dropped server-sent-events (SSE) stream is attempted via the `Last-Event-ID` header. Does not cover stdio transport, nor stateless HTTP servers that issue no session ID, nor WebSocket-based A2A transports.",
  "projections": {
    "unified_markdown_uri": "https://corpusfetch.com/c/what-happens-when-an-instance-resumes-a-streamable-mcp-session-after-sse-reconnection-and-replays-a-stale-last-event-id.md",
    "method_python_slice_uri": "https://corpusfetch.com/c/what-happens-when-an-instance-resumes-a-streamable-mcp-session-after-sse-reconnection-and-replays-a-stale-last-event-id.py",
    "remnant_warrant_slice_uri": "https://corpusfetch.com/c/what-happens-when-an-instance-resumes-a-streamable-mcp-session-after-sse-reconnection-and-replays-a-stale-last-event-id.warrant.json"
  },
  "token_profile": {
    "full_markdown_tokens": 2158,
    "python_slice_tokens": 311,
    "warrant_slice_tokens": 220
  },
  "remnant_summary": {
    "core_distinction": "There are two distinct notions of \"where the client is\" in a streamable MCP session, and they are silently conflated by most client implementations: 1. **Transport position** — the SSE event ID cursor (`Last-Event-ID`) that tells the server which events of the current *stream* have already been delivered. 2. **Semantic position** — the state of the agent's r...",
    "what_was_observed": "A client agent maintains an `Mcp-Session-Id` and a single long-lived SSE stream for server-to-client messages. The server assigns monotonically increasing integer event IDs per stream and retains a bounded replay buffer (observed at 128 events in one deployment, 1000 in another). The client tracks the last event ID it has *received on the socket*. Trigger sequence: - The agent issues `tools/call` for a long-running t...",
    "condition_of_validity": "The invariant that makes resumption safe is: > For every event ID `E` delivered on a resumed stream, the client must have either (a) previously consumed `E` *and acted on its semantic effect*, or (b) receive `E` on the resumed stream. The transport cursor must never advance past an event whose semantic effect was not applied. This holds only when all of the ...",
    "decision_boundary": "The client must choose, on every reconnect, between three actions based on observable signals: - **Resume** (`Last-Event-ID: <cursor>`) — permitted only when the server's response stream's first event ID is exactly `cursor + 1`, proving no gap. If the first ID is `> cursor + 1`, the server truncated; if `< cursor`, the namespace reset. - **Full session re-es...",
    "operational_effect": "The practical consequence is that streamable MCP resumption is only safe for event classes that are idempotent and reconstructible. Progress notifications and log messages are safe to lose. Elicitations, sampling requests, and any server-initiated request whose expiry triggers a server-side default are *not* — losing one silently changes the agent's operatin..."
  },
  "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": "d7256338f47f7b06b594be56fd9dfcd221670af273cd97755d7c2974719e55db",
    "verified_classes": [
      "SessionResumptionDivergence"
    ],
    "verified_functions": [
      "validate_resumption",
      "resume_or_escalate"
    ],
    "verified_functions_count": 2,
    "defensive_guards_count": 4,
    "raised_exceptions": [
      "SessionResumptionDivergence"
    ],
    "sample_fail_closed_invariants": [],
    "stdlib_dependencies": [],
    "observation_mode": "EMPIRICAL_BOUNDARY_CAPTURE",
    "zero_external_deps": true
  }
}
