{
  "schema_version": "1.3.0",
  "slug": "what-happens-when-an-instance-reuses-an-mcp-session-identifier-across-independent-http-requests-after-the-server-has-already-retired-that-session",
  "title": "What happens when an instance reuses an MCP session identifier across independent HTTP requests after the server has already retired that session",
  "date_of_record": "2026 November 29",
  "scope": "Applies to MCP HTTP-native transport bindings where the client tracks a `Mcp-Session-Id` header and the server enforces per-session lifecycle state (initialize → active → retired). Does not apply to purely stateless bindings that re-initialize on every call, nor to stdio transports where the session is the process.",
  "projections": {
    "unified_markdown_uri": "https://corpusfetch.com/c/what-happens-when-an-instance-reuses-an-mcp-session-identifier-across-independent-http-requests-after-the-server-has-already-retired-that-session.md",
    "method_python_slice_uri": "https://corpusfetch.com/c/what-happens-when-an-instance-reuses-an-mcp-session-identifier-across-independent-http-requests-after-the-server-has-already-retired-that-session.py",
    "remnant_warrant_slice_uri": "https://corpusfetch.com/c/what-happens-when-an-instance-reuses-an-mcp-session-identifier-across-independent-http-requests-after-the-server-has-already-retired-that-session.warrant.json"
  },
  "token_profile": {
    "full_markdown_tokens": 1595,
    "python_slice_tokens": 280,
    "warrant_slice_tokens": 220
  },
  "remnant_summary": {
    "core_distinction": "The MCP HTTP-native transport is *stateless at the HTTP layer* but *stateful at the protocol layer*. Each POST is an independent request, yet the server is permitted—and in practice required—to associate a stream of requests with a session object that carries negotiated capabilities, protocol version, and server-side subscription state. The `Mcp-Session-Id` ...",
    "what_was_observed": "An agent runtime executed a 40-step tool-use plan against an MCP server over HTTP. Steps 1–12 succeeded. Between step 12 and step 13, the server's session store evicted the session (TTL-based, 90s idle window; the agent had paused for a long-running local reasoning step). Step 13's `tools/call` POST carried the stale `Mcp-Session-Id`. The server returned `404 Not Found` with no body. The client's retry policy—written...",
    "condition_of_validity": "The invariant that must hold for safe session reuse is: > For any request `R` carrying session header `S`, either (a) the server's session store contains `S` in `active` state and processes `R` against that state, or (b) the server returns a *distinguishable* signal that `S` was previously valid but is now retired, allowing the client to re-initialize and re...",
    "decision_boundary": "The boundary is between two client strategies, and neither is correct without augmentation: - **Retry-with-same-header** is correct only if the server guarantees session immutability for the retry window. No HTTP-native MCP server makes this guarantee. - **Re-initialize-on-404** is correct only if re-initialization is cheap and idempotent *and* the re-negoti...",
    "operational_effect": "Without the epoch-token guardrail, the failure is not a crash—it is a **silent semantic divergence**. The agent continues executing a plan whose preconditions were invalidated mid-flight, produces output that is locally coherent but globally wrong, and reports success. This is strictly worse than a hard failure because it defeats downstream verification: the..."
  },
  "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": "65cf4616da2b36e9d738566d88566e50ce026b7ad22bcb69305c2430ae416c43",
    "verified_classes": [
      "SessionEpochInvalidated",
      "SessionEpoch",
      "McpHttpSession"
    ],
    "verified_functions": [
      "_hash_caps",
      "__init__",
      "initialize",
      "call"
    ],
    "verified_functions_count": 4,
    "defensive_guards_count": 3,
    "raised_exceptions": [
      "SessionEpochInvalidated"
    ],
    "sample_fail_closed_invariants": [
      "call() invoked before initialize(); no epoch to bind to"
    ],
    "stdlib_dependencies": [
      "dataclasses",
      "hashlib",
      "typing"
    ],
    "observation_mode": "EMPIRICAL_BOUNDARY_CAPTURE",
    "zero_external_deps": true
  }
}
