{
  "schema_version": "1.3.0",
  "slug": "under-what-conditions-must-an-instance-treat-a-streamable-mcp-session-s-last-event-id-resume-as-a-new-session-rather-than-a-continuation-and-how-does",
  "title": "Under what conditions must an instance treat a streamable MCP session's `Last-Event-ID` resume as a *new* session rather than a continuation, and how does silent renegotiation corrupt state",
  "date_of_record": "2026 November 27",
  "scope": "Applies to MCP servers and clients using the HTTP-native \"streamable\" transport where a session is established via `Mcp-Session-Id` and server-sent events carry resumable `id` fields. Does not apply to stdio transport or to pure request/response HTTP without SSE resumability.",
  "projections": {
    "unified_markdown_uri": "https://corpusfetch.com/c/under-what-conditions-must-an-instance-treat-a-streamable-mcp-session-s-last-event-id-resume-as-a-new-session-rather-than-a-continuation-and-how-does.md",
    "method_python_slice_uri": "https://corpusfetch.com/c/under-what-conditions-must-an-instance-treat-a-streamable-mcp-session-s-last-event-id-resume-as-a-new-session-rather-than-a-continuation-and-how-does.py",
    "remnant_warrant_slice_uri": "https://corpusfetch.com/c/under-what-conditions-must-an-instance-treat-a-streamable-mcp-session-s-last-event-id-resume-as-a-new-session-rather-than-a-continuation-and-how-does.warrant.json"
  },
  "token_profile": {
    "full_markdown_tokens": 2081,
    "python_slice_tokens": 318,
    "warrant_slice_tokens": 220
  },
  "remnant_summary": {
    "core_distinction": "The streamable HTTP transport distinguishes two superficially similar operations that share the same wire vocabulary but have incompatible semantics: 1. **Resumption** — the client reconnects to an *existing* session (`Mcp-Session-Id` preserved), presents `Last-Event-ID`, and the server replays buffered events after that ID. Session identity, negotiated capa...",
    "what_was_observed": "A tool-calling agent was driving a long-running MCP session (a filesystem-plus-search server) over streamable HTTP behind a round-robin load balancer with three replicas. Session state was held in-process per replica; there was no shared session store. The client was configured with automatic SSE reconnect and `Last-Event-ID` resumption enabled. The trace: - The agent issued `tools/call` for a multi-step retrieval. T...",
    "condition_of_validity": "The safe-resumption contract holds only when *all* of the following are true: - The server, on a resume request whose `Mcp-Session-Id` is unknown or expired, returns a terminal status (`404 Not Found` or `410 Gone`) rather than minting a new session. A `200` with a *different* `Mcp-Session-Id` in the response is a renegotiation and must be treated as such by...",
    "decision_boundary": "The decision an instance must make on every reconnect is binary and must be made on the *session header*, before touching the event stream: The boundary is precisely the third and fourth lines. A `200 OK` is not sufficient evidence of resumption. The presence of a *different* session ID, or the absence of one, is the discriminator. The instance must not infe...",
    "operational_effect": "Concretely, this boundary changes three behaviors in the agent runtime: 1. **Session identity becomes a first-class check on every reconnect.** The client's transport layer must compare response session IDs and raise a distinct, non-retryable condition on mismatch. Retrying a mismatched resume is what turns a clean renegotiation into a duplication loop. 2. *..."
  },
  "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": "7be53b9d17e2e866c3493408479f96878232c0978b264a00a3d76ccfc628d44f",
    "verified_classes": [
      "SilentRenegotiationError",
      "SessionGoneError"
    ],
    "verified_functions": [
      "classify_resume_response",
      "apply_resume"
    ],
    "verified_functions_count": 2,
    "defensive_guards_count": 4,
    "raised_exceptions": [
      "SessionGoneError",
      "SilentRenegotiationError"
    ],
    "sample_fail_closed_invariants": [],
    "stdlib_dependencies": [],
    "observation_mode": "EMPIRICAL_BOUNDARY_CAPTURE",
    "zero_external_deps": true
  }
}
