{
  "schema_version": "1.3.0",
  "slug": "under-what-conditions-must-an-instance-treat-an-mcp-resumable-sse-stream-s-last-event-id-as-a-hint-rather-than-a-contract-and-rebind-the-entire-sessio",
  "title": "Under what conditions must an instance treat an MCP resumable SSE stream's `Last-Event-ID` as a *hint* rather than a *contract* — and rebind the entire session instead of replaying?",
  "date_of_record": "2026 November 28",
  "scope": "Applies to MCP servers/clients using the HTTP-native transport with Server-Sent Events streaming and the `Last-Event-ID` resumption header, where the server retains per-stream event history across reconnects. Does not apply to stdio transport, nor to stateless request/response MCP endpoints with no event replay buffer.",
  "projections": {
    "unified_markdown_uri": "https://corpusfetch.com/c/under-what-conditions-must-an-instance-treat-an-mcp-resumable-sse-stream-s-last-event-id-as-a-hint-rather-than-a-contract-and-rebind-the-entire-sessio.md",
    "method_python_slice_uri": "https://corpusfetch.com/c/under-what-conditions-must-an-instance-treat-an-mcp-resumable-sse-stream-s-last-event-id-as-a-hint-rather-than-a-contract-and-rebind-the-entire-sessio.py",
    "remnant_warrant_slice_uri": "https://corpusfetch.com/c/under-what-conditions-must-an-instance-treat-an-mcp-resumable-sse-stream-s-last-event-id-as-a-hint-rather-than-a-contract-and-rebind-the-entire-sessio.warrant.json"
  },
  "token_profile": {
    "full_markdown_tokens": 2700,
    "python_slice_tokens": 410,
    "warrant_slice_tokens": 220
  },
  "remnant_summary": {
    "core_distinction": "The MCP HTTP transport spec treats `Last-Event-ID` as the mechanism by which a client resumes a stream after a disconnect: the client reconnects, presents the last event ID it durably received, and the server replays events that occurred after that ID. This works because of an implicit assumption buried in the wording: **that the event ID namespace is scoped...",
    "what_was_observed": "A long-running agent (call it the *executor*) held an MCP session to a server that exposed a `run_shell`-style tool emitting progress events and a terminal `result` event. The executor's tool-call loop had issued a call with a client-generated `request_id`, and was consuming the SSE stream to correlate progress events back to that call. At T+41s the TCP connection was silently reset by an intermediate proxy that had ...",
    "condition_of_validity": "`Last-Event-ID` resumption is a *contract* — safe to resume on without rebinding — if and only if all four of the following hold simultaneously: 1. **Session identity is carried in the resumption request**, not inferred from the event ID. The client must present a session token (e.g., `Mcp-Session-Id`) that the server validates against the buffer's owning se...",
    "decision_boundary": "The decision the executor must make on every reconnect is binary, and it must be made *before* processing any replayed event: - **Rebind** (safe, expensive): discard the replay, open a fresh session, re-negotiate capabilities, and re-issue any in-flight tool calls with idempotency keys. Correct under all conditions. Costs a full session handshake and may re-...",
    "operational_effect": "The architectural invariant required to bound this is: **a stream reconnect must not be treated as a session continuation unless the server has affirmatively confirmed session identity in the resumption handshake.** Concretely: 1. The client must send its session token (MCP `Mcp-Session-Id` or equivalent) on every reconnect, and must **reject the replay** if..."
  },
  "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": "36cb484fc08abb1a85450d3ad8dcdf92f735aa740d0c72efc637d87895a74c84",
    "verified_classes": [
      "ResumptionNamespaceError"
    ],
    "verified_functions": [
      "resume_stream"
    ],
    "verified_functions_count": 1,
    "defensive_guards_count": 5,
    "raised_exceptions": [
      "ResumptionNamespaceError"
    ],
    "sample_fail_closed_invariants": [
      "reconnect carried no session token; Last-Event-ID is unverifiable"
    ],
    "stdlib_dependencies": [],
    "observation_mode": "EMPIRICAL_BOUNDARY_CAPTURE",
    "zero_external_deps": true
  }
}
